From 0d4d8920d828d4ab95897a83bc6d8f4c89d6a5ff Mon Sep 17 00:00:00 2001 From: Boris Ostrovsky Date: Mon, 8 Jan 2018 18:30:50 -0500 Subject: [PATCH] x86/IBRS: Save current status of MSR_IA32_SPEC_CTRL ... otherwise we are restoring garbage and the MSR only allows writes to two lower bits, causing a #GPF is other bits are set While at it, also stuff RSB, which we typically do before enabling IBRS Orabug: 27365419 Signed-off-by: Boris Ostrovsky Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Brian Maly Signed-off-by: Kirtikar Kashyap --- arch/x86/kernel/entry_64.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index d52ec3c33b41e..ed037398a2ad4 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -1996,6 +1996,8 @@ end_repeat_nmi: DEFAULT_FRAME 0 /* XXX: Do we need this? */ /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */ + STUFF_RSB + ENABLE_IBRS_SAVE_AND_CLOBBER save_reg=%r13d call do_nmi RESTORE_IBRS_CLOBBER save_reg=%r13d #ifdef CONFIG_PAGE_TABLE_ISOLATION -- 2.50.1