[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCY1j0AksHZQvmWQ@lx-t490>
Date: Thu, 15 May 2025 20:42:23 +0200
From: "Ahmed S. Darwish" <darwi@...utronix.de>
To: Ingo Molnar <mingo@...nel.org>
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()
On Thu, 15 May 2025, Ingo Molnar wrote:
>
> * Ahmed S. Darwish <darwi@...utronix.de> wrote:
> >
> > 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
...
>
> 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.
>
Yeah, I admit I was a little bit uncomfortable about this one, especially
when modifying a call-site like:
=> arch/x86/kernel/paravirt.c:
struct paravirt_patch_template pv_ops = {
.cpu.io_delay = native_io_delay,
.cpu.cpuid = cpuid_native, // stands out
.cpu.read_cr0 = native_read_cr0,
.cpu.write_cr0 = native_write_cr0,
.cpu.write_cr4 = native_write_cr4,
.cpu.read_msr = native_read_msr,
...
};
So, indeed, ACK.
Thanks!
~ Ahmed
Powered by blists - more mailing lists