summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/microcode.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2023-10-02 15:00:08 +0300
committerBorislav Petkov (AMD) <bp@alien8.de>2023-10-24 16:05:55 +0300
commit8f849ff63bcbc77670da03cb8f2b78b06257f455 (patch)
treed53d92a3ca79ec251c1edaa3d046f6e15e3cfb1b /arch/x86/include/asm/microcode.h
parent9cab5fb776d4367e26950cf759211e948335288e (diff)
downloadlinux-8f849ff63bcbc77670da03cb8f2b78b06257f455.tar.xz
x86/microcode: Handle "offline" CPUs correctly
Offline CPUs need to be parked in a safe loop when microcode update is in progress on the primary CPU. Currently, offline CPUs are parked in mwait_play_dead(), and for Intel CPUs, its not a safe instruction, because the MWAIT instruction can be patched in the new microcode update that can cause instability. - Add a new microcode state 'UCODE_OFFLINE' to report status on per-CPU basis. - Force NMI on the offline CPUs. Wake up offline CPUs while the update is in progress and then return them back to mwait_play_dead() after microcode update is complete. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20231002115903.660850472@linutronix.de
Diffstat (limited to 'arch/x86/include/asm/microcode.h')
-rw-r--r--arch/x86/include/asm/microcode.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 82924828a94b..0ee6ed0ff2bf 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -73,6 +73,7 @@ static inline u32 intel_get_microcode_revision(void)
#endif /* !CONFIG_CPU_SUP_INTEL */
bool microcode_nmi_handler(void);
+void microcode_offline_nmi_handler(void);
#ifdef CONFIG_MICROCODE_LATE_LOADING
DECLARE_STATIC_KEY_FALSE(microcode_nmi_handler_enable);