[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCYdlAgG0rrEXtFK@gmail.com>
Date: Thu, 15 May 2025 19:00:04 +0200
From: Ingo Molnar <mingo@...nel.org>
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 8/9] x86/cpuid: Rename native_cpuid() to cpuid_native()
* Ahmed S. Darwish <darwi@...utronix.de> wrote:
> In order to let all the APIs under <cpuid/api.h> have a shared "cpuid_"
> namespace, rename native_cpuid() to cpuid_native().
>
> Adjust all call-sites accordingly.
>
> Suggested-by: Ingo Molnar <mingo@...nel.org>
> Signed-off-by: Ahmed S. Darwish <darwi@...utronix.de>
> ---
> arch/x86/boot/compressed/sev.c | 6 +++---
> arch/x86/include/asm/cpuid/api.h | 6 +++---
> arch/x86/kernel/cpu/microcode/intel.c | 2 +-
> arch/x86/kernel/cpu/microcode/internal.h | 4 ++--
> arch/x86/kernel/paravirt.c | 2 +-
> arch/x86/mm/mem_encrypt_identity.c | 6 +++---
> arch/x86/xen/enlighten_pv.c | 4 ++--
> 7 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c
> index f054bf52c10a..4b617f8f9b7f 100644
> --- a/arch/x86/boot/compressed/sev.c
> +++ b/arch/x86/boot/compressed/sev.c
> @@ -494,7 +494,7 @@ static int sev_check_cpu_support(void)
> /* Check for the SME/SEV support leaf */
> eax = 0x80000000;
> ecx = 0;
> - native_cpuid(&eax, &ebx, &ecx, &edx);
> + cpuid_native(&eax, &ebx, &ecx, &edx);
> if (eax < 0x8000001f)
> return -ENODEV;
I'm torn about this one.
native_*() is a pretty generic way to denote baremetal methods, all
around the x86 tree:
starship:~/tip> git grep -E '\<native_' arch/x86/ | wc -l
682
Likewise for:
native_cpuid_eax()
native_cpuid_ebx()
native_cpuid_ecx()
native_cpuid_edx()
I think it might be better to leave these as native_cpuid_*, because
shifting a naming inconsistency into another namespace isn't really a
net improvement.
'git grep cpuid_eax' will still give meaningful results, so
greppability of cpuid_ APIs only suffers somewhat. The for_each_cpuid_
methods are already outliers.
There's always a bigger fish^W prefix. ;-)
Thanks,
Ingo
Powered by blists - more mailing lists