From: Boris Ostrovsky Date: Mon, 8 Jan 2018 23:30:50 +0000 (-0500) Subject: x86/IBRS: Save current status of MSR_IA32_SPEC_CTRL X-Git-Tag: v4.1.12-124.31.3~1287 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0d4d8920d828d4ab95897a83bc6d8f4c89d6a5ff;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index d52ec3c33b41..ed037398a2ad 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