]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/cpuid: Rename hypervisor_cpuid_base()/for_each_possible_hypervisor_cpuid_base...
authorAhmed S. Darwish <darwi@linutronix.de>
Thu, 15 May 2025 20:28:59 +0000 (22:28 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 16 May 2025 08:54:47 +0000 (10:54 +0200)
In order to let all the APIs under <cpuid/api.h> have a shared "cpuid_"
namespace, rename hypervisor_cpuid_base() to cpuid_base_hypervisor().

To align with the new style, also rename:

    for_each_possible_hypervisor_cpuid_base(function)

to:

    for_each_possible_cpuid_base_hypervisor(function)

Adjust call-sites accordingly.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: x86-cpuid@lists.linux.dev
Link: https://lore.kernel.org/r/aCZOi0Oohc7DpgTo@lx-t490
arch/x86/include/asm/acrn.h
arch/x86/include/asm/cpuid/api.h
arch/x86/include/asm/xen/hypervisor.h
arch/x86/kernel/jailhouse.c
arch/x86/kernel/kvm.c
arch/x86/kvm/cpuid.c

index 1dd14381bcb6301115026799e2851ba287a16a46..fab11192c60a698901c72b225edfc5282417878e 100644 (file)
@@ -25,7 +25,7 @@ void acrn_remove_intr_handler(void);
 static inline u32 acrn_cpuid_base(void)
 {
        if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
-               return hypervisor_cpuid_base("ACRNACRNACRN", 0);
+               return cpuid_base_hypervisor("ACRNACRNACRN", 0);
 
        return 0;
 }
index ccf20c62b89f542bb3cbc56bf0257ad0fcc303ba..44fa82e1267ce98c7f5f92f69b58f79e235f7261 100644 (file)
@@ -188,14 +188,14 @@ static __always_inline bool cpuid_function_is_indexed(u32 function)
        return false;
 }
 
-#define for_each_possible_hypervisor_cpuid_base(function) \
+#define for_each_possible_cpuid_base_hypervisor(function) \
        for (function = 0x40000000; function < 0x40010000; function += 0x100)
 
-static inline u32 hypervisor_cpuid_base(const char *sig, u32 leaves)
+static inline u32 cpuid_base_hypervisor(const char *sig, u32 leaves)
 {
        u32 base, eax, signature[3];
 
-       for_each_possible_hypervisor_cpuid_base(base) {
+       for_each_possible_cpuid_base_hypervisor(base) {
                cpuid(base, &eax, &signature[0], &signature[1], &signature[2]);
 
                /*
index bd0fc69a10a7e80b1027e975afd302d7d83d1a62..c2fc7869b996aedf5693d67f8c66f84792d17788 100644 (file)
@@ -43,7 +43,7 @@ extern struct start_info *xen_start_info;
 
 static inline uint32_t xen_cpuid_base(void)
 {
-       return hypervisor_cpuid_base(XEN_SIGNATURE, 2);
+       return cpuid_base_hypervisor(XEN_SIGNATURE, 2);
 }
 
 struct pci_dev;
index cd8ed1edbf9ee7637d6c557ee61e2799bc2f916d..9e9a591a5fecb4b9da0eabaf7927da56267f387c 100644 (file)
@@ -49,7 +49,7 @@ static uint32_t jailhouse_cpuid_base(void)
            !boot_cpu_has(X86_FEATURE_HYPERVISOR))
                return 0;
 
-       return hypervisor_cpuid_base("Jailhouse\0\0\0", 0);
+       return cpuid_base_hypervisor("Jailhouse\0\0\0", 0);
 }
 
 static uint32_t __init jailhouse_detect(void)
index f3642226e0a558e14ec11cad190ba7fbca39d583..921c1c783bc187dd3a239bf0c1e0e0f45695586c 100644 (file)
@@ -875,7 +875,7 @@ static noinline uint32_t __kvm_cpuid_base(void)
                return 0;       /* So we don't blow up on old processors */
 
        if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
-               return hypervisor_cpuid_base(KVM_SIGNATURE, 0);
+               return cpuid_base_hypervisor(KVM_SIGNATURE, 0);
 
        return 0;
 }
index 7f43d8d24fbefcf05347705e539da16235819462..ecd85f4801cce0d3fde531044cb697e108ba9239 100644 (file)
@@ -236,7 +236,7 @@ static struct kvm_hypervisor_cpuid kvm_get_hypervisor_cpuid(struct kvm_vcpu *vcp
        struct kvm_cpuid_entry2 *entry;
        u32 base;
 
-       for_each_possible_hypervisor_cpuid_base(base) {
+       for_each_possible_cpuid_base_hypervisor(base) {
                entry = kvm_find_cpuid_entry(vcpu, base);
 
                if (entry) {