KVM: x86: generalize guest_cpuid_has_ helpers
This patch turns guest_cpuid_has_XYZ(cpuid) into guest_cpuid_has(cpuid, X86_FEATURE_XYZ), which gets rid of many very similar helpers. When seeing a X86_FEATURE_*, we can know which cpuid it belongs to, but this information isn't in common code, so we recreate it for KVM. Add some BUILD_BUG_ONs to make sure that it runs nicely. Signed-off-by:Radim Krčmář <rkrcmar@redhat.com> Reviewed-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Showing
- arch/x86/kvm/cpuid.h 57 additions, 113 deletionsarch/x86/kvm/cpuid.h
- arch/x86/kvm/mmu.c 4 additions, 3 deletionsarch/x86/kvm/mmu.c
- arch/x86/kvm/mtrr.c 1 addition, 1 deletionarch/x86/kvm/mtrr.c
- arch/x86/kvm/svm.c 1 addition, 1 deletionarch/x86/kvm/svm.c
- arch/x86/kvm/vmx.c 12 additions, 14 deletionsarch/x86/kvm/vmx.c
- arch/x86/kvm/x86.c 20 additions, 18 deletionsarch/x86/kvm/x86.c
Please register or sign in to comment