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

"Ahmed S. Darwish (dev)" <[email protected]>
Newsgroups dev.linux.lists.x86-cpuid,org.kernel.vger.linux-kernel
Message-ID <aB3R_5_aSCeGeLVr@lx-t490>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.