diff options
author | Sean Christopherson <seanjc@google.com> | 2024-04-06 01:56:03 +0200 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-06-10 23:29:39 +0200 |
commit | 1028893a73fe20b2d1b90b4a6005b288286b9309 (patch) | |
tree | cc05bfef7060865a5e74231c9f47b6aeae8f085f /arch/x86/kvm/cpuid.h | |
parent | KVM: x86: Open code vendor_intel() in string_registers_quirk() (diff) | |
download | linux-1028893a73fe20b2d1b90b4a6005b288286b9309.tar.xz linux-1028893a73fe20b2d1b90b4a6005b288286b9309.zip |
KVM: x86: Bury guest_cpuid_is_amd_or_hygon() in cpuid.c
Move guest_cpuid_is_amd_or_hygon() into cpuid.c now that, except for one
Intel quirk in the emulator, KVM checks for AMD vs. Intel *compatible*
vCPUs, not exact vendors, i.e. now that there should not be any reason for
KVM at-large to care about the exact vendor.
Opportunistically refactor the guts of the helper to use "entry" instead
of "best", and short circuit the !entry path to make the common case more
readable.
Link: https://lore.kernel.org/r/20240405235603.1173076-11-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/cpuid.h')
-rw-r--r-- | arch/x86/kvm/cpuid.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index 03d015e9ce33..41697cca354e 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h @@ -102,16 +102,6 @@ static __always_inline void guest_cpuid_clear(struct kvm_vcpu *vcpu, *reg &= ~__feature_bit(x86_feature); } -static inline bool guest_cpuid_is_amd_or_hygon(struct kvm_vcpu *vcpu) -{ - struct kvm_cpuid_entry2 *best; - - best = kvm_find_cpuid_entry(vcpu, 0); - return best && - (is_guest_vendor_amd(best->ebx, best->ecx, best->edx) || - is_guest_vendor_hygon(best->ebx, best->ecx, best->edx)); -} - static inline bool guest_cpuid_is_amd_compatible(struct kvm_vcpu *vcpu) { return vcpu->arch.is_amd_compatible; |