Commit 3bf8ce82 authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Ingo Molnar
Browse files

x86/cpuid: Rename...


x86/cpuid: Rename hypervisor_cpuid_base()/for_each_possible_hypervisor_cpuid_base() to cpuid_base_hypervisor()/for_each_possible_cpuid_base_hypervisor()

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: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarAhmed S. Darwish <darwi@linutronix.de>
Signed-off-by: default avatarIngo 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
parent 119deb95
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}
+3 −3
Original line number Diff line number Diff line
@@ -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]);

		/*
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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;
}
Loading