x86/smpboot: Implement a bit spinlock to protect the realmode stack
authorThomas Gleixner <tglx@linutronix.de>
Fri, 12 May 2023 21:07:53 +0000 (23:07 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 15 May 2023 11:45:03 +0000 (13:45 +0200)
commitf6f1ae9128d2a080ecdd55f85e8a0ca3ed1d58eb
tree4555b22acd29516c4d70dcd7ec0d2c412b441730
parentbea629d57d006733d155bdb65ba4867788da69b6
x86/smpboot: Implement a bit spinlock to protect the realmode stack

Parallel AP bringup requires that the APs can run fully parallel through
the early startup code including the real mode trampoline.

To prepare for this implement a bit-spinlock to serialize access to the
real mode stack so that parallel upcoming APs are not going to corrupt each
others stack while going through the real mode startup code.

Co-developed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Tested-by: Helge Deller <deller@gmx.de> # parisc
Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com> # Steam Deck
Link: https://lore.kernel.org/r/20230512205257.355425551@linutronix.de
arch/x86/include/asm/realmode.h
arch/x86/kernel/head_64.S
arch/x86/realmode/init.c
arch/x86/realmode/rm/trampoline_64.S