x86/smp: Use dedicated cache-line for mwait_play_dead()
authorThomas Gleixner <tglx@linutronix.de>
Thu, 15 Jun 2023 20:33:55 +0000 (22:33 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 20 Jun 2023 12:51:47 +0000 (14:51 +0200)
commitf9c9987bf52f4e42e940ae217333ebb5a4c3b506
treedbe59974c15a712c3491253d3caac47b18306bc2
parent2affa6d6db28855e6340b060b809c23477aa546e
x86/smp: Use dedicated cache-line for mwait_play_dead()

Monitoring idletask::thread_info::flags in mwait_play_dead() has been an
obvious choice as all what is needed is a cache line which is not written
by other CPUs.

But there is a use case where a "dead" CPU needs to be brought out of
MWAIT: kexec().

This is required as kexec() can overwrite text, pagetables, stacks and the
monitored cacheline of the original kernel. The latter causes MWAIT to
resume execution which obviously causes havoc on the kexec kernel which
results usually in triple faults.

Use a dedicated per CPU storage to prepare for that.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230615193330.434553750@linutronix.de
arch/x86/kernel/smpboot.c