Commit 6d527ceb authored by Sean Christopherson's avatar Sean Christopherson Committed by Borislav Petkov

x86/mce: WARN once if IA32_FEAT_CTL MSR is left unlocked

WARN if the IA32_FEAT_CTL MSR is somehow left unlocked now that CPU
initialization unconditionally locks the MSR.
Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20191221044513.21680-6-sean.j.christopherson@intel.com
parent 1db2a6e1
...@@ -116,14 +116,15 @@ static bool lmce_supported(void) ...@@ -116,14 +116,15 @@ static bool lmce_supported(void)
/* /*
* BIOS should indicate support for LMCE by setting bit 20 in * BIOS should indicate support for LMCE by setting bit 20 in
* IA32_FEAT_CTL without which touching MCG_EXT_CTL will generate a #GP * IA32_FEAT_CTL without which touching MCG_EXT_CTL will generate a #GP
* fault. * fault. The MSR must also be locked for LMCE_ENABLED to take effect.
* WARN if the MSR isn't locked as init_ia32_feat_ctl() unconditionally
* locks the MSR in the event that it wasn't already locked by BIOS.
*/ */
rdmsrl(MSR_IA32_FEAT_CTL, tmp); rdmsrl(MSR_IA32_FEAT_CTL, tmp);
if ((tmp & (FEAT_CTL_LOCKED | FEAT_CTL_LMCE_ENABLED)) == if (WARN_ON_ONCE(!(tmp & FEAT_CTL_LOCKED)))
(FEAT_CTL_LOCKED | FEAT_CTL_LMCE_ENABLED)) return false;
return true;
return false; return tmp & FEAT_CTL_LMCE_ENABLED;
} }
bool mce_intel_cmci_poll(void) bool mce_intel_cmci_poll(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment