Re: [PATCH v11 4/4] x86/cpu: Clear feature bits whose dependencies were cleared
From: Maciej Wieczor-Retman
Date: Mon Mar 23 2026 - 15:00:56 EST
On 2026-03-23 at 18:59:02 +0100, Borislav Petkov wrote:
>On Mon, Mar 23, 2026 at 05:23:19PM +0000, Maciej Wieczor-Retman wrote:
>> Clearing the compile time disabled bits is fairly low effort since it's just
>> initializing the cpu_caps_cleared[].
>
>and cpu_caps_cleared[] is consulted in apply_forced_caps().
>
>> To validate the whole cpuid_deps[] array and add relevant bits to
>> cpu_caps_cleared[] would probably require adding another loop that would
>> check all of the entries. Since now only SGX has this problem I didn't think
>> it warranted adding more than this check in check_cpufeature_deps().
>
>So we're going to do half-baked solution again and it'll come to bite us in
>the ass later?
>
>How about we hammer it out properly once and for all?
>
>--
>Regards/Gruss,
> Boris.
>
>https://people.kernel.org/tglx/notes-about-netiquette
Okay, I'll work on a helper/loop to check the whole array and clear such cases
somewhat early so the warning in check_cpufeature_deps() doesn't get triggered.
--
Kind regards
Maciej Wieczór-Retman