lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lvhvludvyuf2xj77qtso7lcyu4ksjigme7xuui3uuqzy2rseyp@dkgerndofq2l>
Date: Tue, 22 Jul 2025 17:43:15 +0200
From: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
To: Dave Hansen <dave.hansen@...el.com>
CC: Xin Li <xin@...or.com>, 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 2025-07-22 at 07:11:47 -0700, Dave Hansen wrote:
>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.

I'll apply Xin's suggestions, test and resend.

-- 
Kind regards
Maciej Wieczór-Retman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ