Re: [PATCH v4 1/6] x86/cpu: Use a new feature flag for 5 level paging

From: Borislav Petkov
Date: Mon May 19 2025 - 09:20:16 EST


On Mon, May 19, 2025 at 03:08:56PM +0200, Ingo Molnar wrote:
> The second best thing we can do is to have a sane, constant LA57 flag
> for the hardware capability, and introduce a synthethic flag that is
> set conditionally (X86_FEATURE_5LEVEL_PAGING) - which is how it should
> have been done originally, and to maintain compatibility, expose the
> synthethic flag in /proc/cpuinfo as 'la57' to maintain the ABI.

- we don't expose every CPUID flag in /proc/cpuinfo for obvious reasons:

Documentation/arch/x86/cpuinfo.rst

- if you want to mirror CPUID *capability* flags with X86_FEATURE flags *and*
use the same alternatives infrastructure to test *enabled* feature flags,
then you almost always must define *two* flags - a capability one or an
enabled one. I don't think we want that.

And since we're dealing with ancient infrastructure which has grown warts over
the years, we all - x86 maintainers - need to decide here how we should go
forward. I have raised these questions multiple times but we have never
discussed it properly.

Also, Ahmed and tglx are working on a unified CPUID view where you can test
capability. Which means, what is enabled can be used solely by the
X86_FEATURE flags but I haven't looked at his set yet.

So it is high time we sit down and hammer out the rules for the feature flags
as apparently what we have now is a total mess.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette