summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/arm64-preempt-Fixup-lazy-preempt.patch
blob: a76b67794587d0c707dd33d6c7679677f97c8e65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Tue, 13 Aug 2019 11:53:23 +0200
Subject: [PATCH] arm64: preempt: Fixup lazy preempt
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz

The irq-exit assmebly checks preempt count and need-resched flag
followed by lazy-preempt status. This is a bug. It should schedule if
preempt-count is zero _and_ need_resched is set _or_ preempt-count is
zero and check the lazy-preempt status.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/arm64/kernel/entry.S |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -680,7 +680,8 @@ alternative_if ARM64_HAS_IRQ_PRIO_MASKIN
 	orr	x24, x24, x0
 alternative_else_nop_endif
 
-	cbnz	x24, 2f					// preempt count != 0
+	cbz	x24, 1f					// (need_resched + count) == 0
+	cbnz	w24, 2f					// count != 0
 
 	ldr	w24, [tsk, #TSK_TI_PREEMPT_LAZY]	// get preempt lazy count
 	cbnz	w24, 2f					// preempt lazy count != 0