Re: [PATCH v6 10/90] x86/cpu: Rescan CPUID table after disabling PSN

From: Ahmed S. Darwish

Date: Wed May 13 2026 - 12:41:38 EST


On Wed, 13 May 2026, Borislav Petkov wrote:
>
> index 01b64d04eb3b..c51cdcad7875 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
...
> clear_cpu_cap(c, X86_FEATURE_PN);
...
>
> - rescan_from = min_t(int, l0->max_std_leaf, c->cpuid_level) + 1;
> - cpuid_refresh_range(c, rescan_from, CPUID_BASE_END);
> c->cpuid_level = l0->max_std_leaf;
> +
> + /* Rescan from the whole range. */
> + cpuid_refresh_range(c, 0, CPUID_BASE_END);
> }
>

That will break the clear_cpu_cap() just some few lines above it. That is,
it will reset all feature flags force set or unset by the kernel.

I'm sending another patch queue iteration shortly that have a new API
function abstracting this min_t() logic in its own parser function, along
with better documentation:

https://lkml.kernel.org/agSfWTxs9pRPHJxl@lx-t490/

The few CPUID patches now merged at tip:x86/cpu will also be in that patch
queue so that everything applies cleanly over -rc3.

Sounds good?

Thanks!
Ahmed