[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9dabe435-7208-4aa8-886c-a3351ee11e80@zytor.com>
Date: Wed, 29 May 2024 13:49:40 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Jacob Pan <jacob.jun.pan@...ux.intel.com>, 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>
Cc: Andi Kleen <andi.kleen@...el.com>, Xin Li <xin3.li@...el.com>
Subject: Re: [PATCH 1/6] x86/irq: Add enumeration of NMI source reporting CPU
feature
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:
> 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.
-hpa
Powered by blists - more mailing lists