[linux-yocto] [PATCH] x86: lazy-preempt: use proper return label on 32bit-x86

zhe.he at windriver.com zhe.he at windriver.com
Mon Mar 18 05:04:30 PDT 2019


From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>

The lazy-preempt uses the wrong return label in case preemption isn't
possible. This results crash while returning to the kernel.

Use the correct return label if preemption isn' possible.

Reported-by: Andri Yngvason <andri at yngvason.is>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>

commit 2c85fda444207949be4ad5e38a49ee8b4e5171cb upstream

Fix x86 32bit boot failure and hang.

Signed-off-by: He Zhe <zhe.he at windriver.com>
---
 arch/x86/entry/entry_32.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 0169c25..e6f61c8 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -773,15 +773,15 @@ ENTRY(resume_kernel)
 
 	# atleast preempt count == 0 ?
 	cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count)
-	jne restore_all
+	jne	restore_all_kernel
 
 	movl	PER_CPU_VAR(current_task), %ebp
 	cmpl	$0,TASK_TI_preempt_lazy_count(%ebp)	# non-zero preempt_lazy_count ?
-	jnz	restore_all
+	jnz	restore_all_kernel
 
 	testl	$_TIF_NEED_RESCHED_LAZY, TASK_TI_flags(%ebp)
-	jz	restore_all
-	test_int_off:
+	jz	restore_all_kernel
+test_int_off:
 #endif
 	testl	$X86_EFLAGS_IF, PT_EFLAGS(%esp)	# interrupts off (exception path) ?
 	jz	restore_all_kernel
-- 
2.7.4



More information about the linux-yocto mailing list