[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0390b5e0-f32d-400b-b2e3-b1c9cf162c69@intel.com>
Date: Tue, 22 Jul 2025 07:11:47 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Xin Li <xin@...or.com>,
Wieczor-Retman Maciej <maciej.wieczor-retman@...el.com>
Cc: Gleixner Thomas <tglx@...utronix.de>, Molnar Ingo <mingo@...hat.com>,
Petkov Borislav <bp@...en8.de>, Hansen Dave <dave.hansen@...ux.intel.com>,
x86@...nel.org, "Anvin H. Peter" <hpa@...or.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: Clear LAM and FRED feature bits
On 7/22/25 02:08, Xin Li wrote:
>> + /*
>> + * If a feature is disabled during compile time clear its feature
>> + * bit to prevent it from showing up in the x86_capability bitmask.
>> + */
>> + if (!cpu_feature_enabled(X86_FEATURE_LAM))
>> + setup_clear_cpu_cap(X86_FEATURE_LAM);
>> +
>> + if (!cpu_feature_enabled(X86_FEATURE_FRED))
>> + setup_clear_cpu_cap(X86_FEATURE_FRED);
>> +
>
> The following code will work as a generic fix:
>
> c->x86_capability[i] &= ~DISABLED_MASK(i);
>
> And DISABLED_MASK(x) needs to be defined like DISABLED_MASK_BIT_SET(x).
Maciej, I would much rather have a generic fix than force everyone to
remember to open-code this for every new feature that gets disabled.
Powered by blists - more mailing lists