Skip to contentSkip to conversation

x86-32: fix stalled boot issues due to missing thread info in %ebp

PATCH Applied Paul Gortmaker 2 participants 2 messages Oct 21, 2016 – Oct 24, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86-32: fix stalled boot issues due to missing thread info in %ebp

In 4.7 development window, we got commit 1e17880371f8 ("x86/entry/32:
Remove GET_THREAD_INFO() from entry code") which said:

The entry code used to cache the thread_info pointer in the EBP register, but all the code that used it has been moved to C. Remove the unused code to get the pointer.

The problem arises when this commit interacts with the -rt patch "x86: Support for lazy preemption" -- as it added another instance where we were expecting thread info in %ebp. But after the upstream commit we end up looking for preempt_lazy in whatever random junk was left there, which doesn't work so well.

Load up %ebp just before we try to use it ; this is also basically what x86-64 does in the -rt preempt lazy patch mentioned above, but it instead uses %rcx.

arch/x86/entry/entry_32.S +1 -0
index aa149231b1ff..1d8ee026c9c5 100644
@@ -282,6 +282,7 @@ need_resched:
 	cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count)
 	jne restore_all
 
+	GET_THREAD_INFO(%ebp)
 	cmpl $0,TI_preempt_lazy_count(%ebp)	# non-zero preempt_lazy_count ?
 	jnz restore_all
 
Signature · 1 line
2.10.0
#1 lore raw
Quoted 3 lines · Paul Gortmaker

Load up %ebp just before we try to use it ; this is also basically what x86-64 does in the -rt preempt lazy patch mentioned above, but it instead uses %rcx.

Applied, thanks.

Quoted 1 line

Sebastian