[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240530133958.229975d1@jacob-builder>
Date: Thu, 30 May 2024 13:39:58 -0700
From: Jacob Pan <jacob.jun.pan@...ux.intel.com>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: X86 Kernel <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>, Thomas
Gleixner <tglx@...utronix.de>, Dave Hansen <dave.hansen@...el.com>, Ingo
Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
linux-perf-users@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>,
Andi Kleen <andi.kleen@...el.com>, Xin Li <xin3.li@...el.com>,
jacob.jun.pan@...ux.intel.com
Subject: Re: [PATCH 1/6] x86/irq: Add enumeration of NMI source reporting
CPU feature
Hi Jacob,
On Thu, 30 May 2024 09:19:16 -0700, Jacob Pan
<jacob.jun.pan@...ux.intel.com> wrote:
> Hi Peter,
>
> On Wed, 29 May 2024 13:49:40 -0700, "H. Peter Anvin" <hpa@...or.com>
> wrote:
>
> > On 5/29/24 13:33, Jacob Pan wrote:
> > > diff --git a/arch/x86/kernel/cpu/cpuid-deps.c
> > > b/arch/x86/kernel/cpu/cpuid-deps.c index b7d9f530ae16..3f1a1a1961fa
> > > 100644 --- a/arch/x86/kernel/cpu/cpuid-deps.c
> > > +++ b/arch/x86/kernel/cpu/cpuid-deps.c
> > > @@ -84,6 +84,7 @@ static const struct cpuid_dep cpuid_deps[] = {
> > > { X86_FEATURE_SHSTK,
> > > X86_FEATURE_XSAVES }, { X86_FEATURE_FRED,
> > > X86_FEATURE_LKGS }, { X86_FEATURE_FRED,
> > > X86_FEATURE_WRMSRNS },
> > > + { X86_FEATURE_FRED,
> > > X86_FEATURE_NMI_SOURCE}, {}
> > > };
> > >
> >
> > This is incorrect. FRED does *not* inherently depend on NMI_SOURCE; the
> > dependency is the reverse, but since it *also* depends on FRED being
> > dynamically enabled, there is no need to add it to the static table;
> > the dynamic test:
> >
> My misunderstanding of the dependency table, thanks for pointing it out.
> Will remove.
>
> > > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> > > index 4fa0b17e5043..465f04e4a79f 100644
> > > --- a/arch/x86/kernel/traps.c
> > > +++ b/arch/x86/kernel/traps.c
> > > @@ -1427,8 +1427,10 @@ early_param("fred", fred_setup);
> > >
> > > void __init trap_init(void)
> > > {
> > > - if (cpu_feature_enabled(X86_FEATURE_FRED) && !enable_fred)
> > > + if (cpu_feature_enabled(X86_FEATURE_FRED) && !enable_fred) {
> > > setup_clear_cpu_cap(X86_FEATURE_FRED);
> > > + setup_clear_cpu_cap(X86_FEATURE_NMI_SOURCE);
> > > + }
> > >
> > > /* Init cpu_entry_area before IST entries are set up */
> > > setup_cpu_entry_areas();
> >
> > ... suffices just fine on its own.
> I am not following, do you mean checking for FRED is sufficient for NMI
> source? I think it works since NMI source cannot be disabled if FRED is
> on. Just want to use the architectural CPUID bits to the fullest.
>
Nevermind, I got it now, will keep the dynamic test.
Thanks,
Jacob
Powered by blists - more mailing lists