x86-32: fix stalled boot issues due to missing thread info in %ebp
Subsystems (2)
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
@@ -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
Sebastian Andrzej Siewior
AppliedQuoted 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
Signed-off-by Paul Gortmaker <[email protected]>
Sebastian