]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: selftests: Inline "get max CPUID leaf" helpers
authorSean Christopherson <seanjc@google.com>
Tue, 14 Jun 2022 20:07:02 +0000 (20:07 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 14 Jul 2022 01:14:23 +0000 (18:14 -0700)
Make the "get max CPUID leaf" helpers static inline, there's no reason to
bury the one liners in processor.c.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20220614200707.3315957-38-seanjc@google.com
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/lib/x86_64/processor.c

index ba5cd86a856518272e65a8f38b2d5ab25d81a132..ecf2ace952ab03391a26cff9f84ce515848644f2 100644 (file)
@@ -721,9 +721,16 @@ static inline void vcpu_set_msr(struct kvm_vcpu *vcpu, uint64_t msr_index,
        TEST_ASSERT(r == 1, KVM_IOCTL_ERROR(KVM_SET_MSRS, r));
 }
 
+static inline uint32_t kvm_get_cpuid_max_basic(void)
+{
+       return kvm_get_supported_cpuid_entry(0)->eax;
+}
+
+static inline uint32_t kvm_get_cpuid_max_extended(void)
+{
+       return kvm_get_supported_cpuid_entry(0x80000000)->eax;
+}
 
-uint32_t kvm_get_cpuid_max_basic(void);
-uint32_t kvm_get_cpuid_max_extended(void);
 void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits);
 bool vm_is_unrestricted_guest(struct kvm_vm *vm);
 
index 5f62b58433d3e035b3e071efb1cbcd98eed044ed..e2894b5bcfd133d63a245a0872c2acfbbca12f7b 100644 (file)
@@ -1056,16 +1056,6 @@ bool is_amd_cpu(void)
        return cpu_vendor_string_is("AuthenticAMD");
 }
 
-uint32_t kvm_get_cpuid_max_basic(void)
-{
-       return kvm_get_supported_cpuid_entry(0)->eax;
-}
-
-uint32_t kvm_get_cpuid_max_extended(void)
-{
-       return kvm_get_supported_cpuid_entry(0x80000000)->eax;
-}
-
 void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
 {
        const struct kvm_cpuid_entry2 *entry;