Re: [PATCH 11/11] x86/cpu: Make all all CPUID leaf names consistent

From: Borislav Petkov
Date: Tue Dec 10 2024 - 06:28:31 EST


On Mon, Dec 09, 2024 at 08:27:58AM -0800, Sean Christopherson wrote:
> > > And having a "CPUID_" prefixed thing and a "CPUID_LEAF_" prefixed other thing
> > > is going to cause confusion.
>
> +1.
>
> What about CPUID_FN_xxx for thing architectural leaf function number? E.g.
> CPUID_FN_80000007 or maybe even CPUID_FN_0x80000007. CPUID_LEAF_xxx is arguably
> wrong anyways for entries with sub-leaves.

Makes sense to me.

Especially if the name already has the function number in it too, which is
self-documenting.

Vs.

CPUID_FN_XSTATE

which will make me go lookup what that "XSTATE" function number was...

In any case, I think having a clear distinction in the naming between

* arch/hw names: CPUID_FN

* our own: CPUID_LNX_...

should help.

And once we're clear on the nomenclature, the conversion will happen
"automatically". :)

Thx.

--
Regards/Gruss,
Boris.

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