lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aB3R_5_aSCeGeLVr@lx-t490>
Date: Fri, 9 May 2025 11:59:27 +0200
From: "Ahmed S. Darwish (dev)" <darwi.dev@...heline.de>
To: "Ahmed S. Darwish" <darwi@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Cooper <andrew.cooper3@...rix.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	John Ogness <john.ogness@...utronix.de>, x86@...nel.org,
	x86-cpuid@...ts.linux.dev, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 9/9] x86/cpuid: Rename native_cpuid_REG() to
 cpuid_native_REG()

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ