[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191025142248.GD6483@zn.tnic>
Date: Fri, 25 Oct 2019 16:22:48 +0200
From: Borislav Petkov <bp@...en8.de>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Tony Luck <tony.luck@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-edac@...r.kernel.org,
linux-kernel@...r.kernel.org,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>, kvm@...r.kernel.org
Subject: Re: [PATCH v2 02/16] x86/mce: WARN once if IA32_FEATURE_CONTROL MSR
is left unlocked
On Mon, Oct 21, 2019 at 04:56:42PM -0700, Sean Christopherson wrote:
> WARN if the IA32_FEATURE_CONTROL MSR is somehow left unlocked now that
> CPU initialization unconditionally locks the MSR.
>
> Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
> Cc: Wanpeng Li <wanpengli@...cent.com>
> Cc: Jim Mattson <jmattson@...gle.com>
> Cc: kvm@...r.kernel.org
> Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
> ---
> arch/x86/kernel/cpu/mce/intel.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/mce/intel.c b/arch/x86/kernel/cpu/mce/intel.c
> index 88cd9598fa57..1008f14b803b 100644
> --- a/arch/x86/kernel/cpu/mce/intel.c
> +++ b/arch/x86/kernel/cpu/mce/intel.c
> @@ -117,11 +117,10 @@ static bool lmce_supported(void)
> * generate a #GP fault.
> */
> rdmsrl(MSR_IA32_FEATURE_CONTROL, tmp);
> - if ((tmp & (FEATURE_CONTROL_LOCKED | FEATURE_CONTROL_LMCE)) ==
> - (FEATURE_CONTROL_LOCKED | FEATURE_CONTROL_LMCE))
> - return true;
> + if (WARN_ON_ONCE(!(tmp & FEATURE_CONTROL_LOCKED)))
> + return false;
>
> - return false;
> + return tmp & FEATURE_CONTROL_LMCE;
> }
>
> bool mce_intel_cmci_poll(void)
> --
Reviewed-by: Borislav Petkov <bp@...e.de>
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists