All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: "Ahmed S. Darwish" <darwi@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	John Ogness <john.ogness@linutronix.de>,
	x86@kernel.org, x86-cpuid@lists.linux.dev,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 8/9] x86/cpuid: Rename native_cpuid() to cpuid_native()
Date: Thu, 15 May 2025 19:00:04 +0200	[thread overview]
Message-ID: <aCYdlAgG0rrEXtFK@gmail.com> (raw)
In-Reply-To: <20250508150240.172915-9-darwi@linutronix.de>


* Ahmed S. Darwish <darwi@linutronix.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@kernel.org>
> Signed-off-by: Ahmed S. Darwish <darwi@linutronix.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

  reply	other threads:[~2025-05-15 17:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08 15:02 [PATCH v1 0/9] x86/cpuid: Headers cleanup Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 1/9] x86/cpuid: Move CPUID(0x2) APIs into <cpuid/api.h> Ahmed S. Darwish
2025-05-15 17:17   ` [tip: x86/core] " tip-bot2 for Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 2/9] x86/cpuid: Set <asm/cpuid/api.h> as the main CPUID header Ahmed S. Darwish
2025-05-15 16:25   ` Ingo Molnar
2025-05-15 18:29     ` Ahmed S. Darwish
2025-05-15 17:17   ` [tip: x86/core] " tip-bot2 for Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 3/9] x86/cpuid: Rename have_cpuid_p() to cpuid_feature() Ahmed S. Darwish
2025-05-15 17:17   ` [tip: x86/core] " tip-bot2 for Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 4/9] x86/cpuid: Rename hypervisor_cpuid_base() to cpuid_hypervisor_base() Ahmed S. Darwish
2025-05-15 16:40   ` Ingo Molnar
2025-05-15 18:31     ` Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 5/9] x86/cpuid: Rename cpuid_get_leaf_0x2_regs() to cpuid_leaf_0x2() Ahmed S. Darwish
2025-05-15 17:17   ` [tip: x86/core] " tip-bot2 for Ahmed S. Darwish
2025-05-16  9:01   ` tip-bot2 for Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 6/9] x86/cacheinfo: Rename CPUID(0x2) descriptors iterator parameter Ahmed S. Darwish
2025-05-15 17:17   ` [tip: x86/core] " tip-bot2 for Ahmed S. Darwish
2025-05-16  9:00   ` tip-bot2 for Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 7/9] x86/cpu: " Ahmed S. Darwish
2025-05-15 17:17   ` [tip: x86/core] x86/cpu/intel: " tip-bot2 for Ahmed S. Darwish
2025-05-16  9:00   ` tip-bot2 for Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 8/9] x86/cpuid: Rename native_cpuid() to cpuid_native() Ahmed S. Darwish
2025-05-15 17:00   ` Ingo Molnar [this message]
2025-05-15 18:42     ` Ahmed S. Darwish
2025-05-08 15:02 ` [PATCH v1 9/9] x86/cpuid: Rename native_cpuid_REG() to cpuid_native_REG() Ahmed S. Darwish
2025-05-09  9:59   ` Ahmed S. Darwish (dev)
2025-05-08 18:49 ` [PATCH v1 0/9] x86/cpuid: Headers cleanup Ahmed S. Darwish
2025-05-15 16:51 ` Ingo Molnar
2025-05-15 18:50   ` Ahmed S. Darwish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aCYdlAgG0rrEXtFK@gmail.com \
    --to=mingo@kernel.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=darwi@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86-cpuid@lists.linux.dev \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.