Re: [PATCH v1 9/9] x86/cpuid: Rename native_cpuid_REG() to cpuid_native_REG()

From: Ahmed S. Darwish (dev)
Date: Fri May 09 2025 - 05:59:41 EST


On Thu, 08 May 2025, Ahmed S. Darwish wrote:
>
> - native_cpuid_eax(1);
> + cpuid_native_eax(1);
>
...
>
> - cpuid_1_eax = native_cpuid_eax(1);
> + cpuid_1_eax = cpuid_native_eax(1);
>

Now that I'm looking at this with fresher eyes, I think below form would
be much better:

cpuid_eax_native()
cpuid_ebx_native()
cpuid_ecx_native()
cpuid_edx_native()

So that it aligns with:

cpuid_eax()
cpuid_ebx()
cpuid_ecx()
cpuid_edx()

at the rest of the <cpuid/api.h> header. Thus the diff becomes:

- cpuid_1_eax = native_cpuid_eax(1);
+ cpuid_1_eax = cpuid_eax_native(1);

- if (native_cpuid_ecx(1) & BIT(31))
+ if (cpuid_ecx_native(1) & BIT(31))

But I'll wait for review feedback before rolling a v2. Maybe people want
to keep having "native_" at the start, instead of forcing a strict
"cpuid_" namespace.

(With "CPUID refactoring" hat on, and as the above mini diff shows, I
honestly think forcing a "cpuid_" namespace, even on native OPs, is much
cleaner.)

Thanks,
~ Ahmed