[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191121104538.GD20907@linux.intel.com>
Date: Thu, 21 Nov 2019 12:45:38 +0200
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Tony Luck <tony.luck@...el.com>,
Tony W Wang-oc <TonyWWang-oc@...oxin.com>,
Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, linux-edac@...r.kernel.org,
linux-kselftest@...r.kernel.org, Borislav Petkov <bp@...e.de>
Subject: Re: [PATCH v3 05/19] x86/mce: WARN once if IA32_FEATURE_CONTROL MSR
is left unlocked
On Mon, Nov 18, 2019 at 07:12:26PM -0800, Sean Christopherson wrote:
> WARN if the IA32_FEATURE_CONTROL MSR is somehow left unlocked now that
> CPU initialization unconditionally locks the MSR.
>
> Reviewed-by: Borislav Petkov <bp@...e.de>
> 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 3e5b29acd301..5abc55a67fce 100644
> --- a/arch/x86/kernel/cpu/mce/intel.c
> +++ b/arch/x86/kernel/cpu/mce/intel.c
> @@ -119,11 +119,10 @@ static bool lmce_supported(void)
> * generate a #GP fault.
> */
> rdmsrl(MSR_IA32_FEATURE_CONTROL, tmp);
> - if ((tmp & (FEAT_CTL_LOCKED | FEAT_CTL_LMCE_ENABLED)) ==
> - (FEAT_CTL_LOCKED | FEAT_CTL_LMCE_ENABLED))
> - return true;
I'd add a prepending comment:
/*
* FEAT_CTL_LOCKED should have been always set either by
* BIOS before handover to the kernel or init_feature_control_msr().
*/
> + if (WARN_ON_ONCE(!(tmp & FEAT_CTL_LOCKED)))
> + return false;
>
> - return false;
> + return tmp & FEAT_CTL_LMCE_ENABLED;
> }
>
> bool mce_intel_cmci_poll(void)
> --
> 2.24.0
>
/Jarkko
Powered by blists - more mailing lists