]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: x86: Add dedicated emulator helpers for querying CPUID features
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 17 Dec 2019 21:32:38 +0000 (13:32 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 21 Jan 2020 12:58:22 +0000 (13:58 +0100)
commit5ae78e95ed0c771935d0d24291d221312524830c
tree71f114e4508e31d0c43cd986c141dc4f03e96acb
parent345599f9a292899bf5474651f3cea9b7a0576436
KVM: x86: Add dedicated emulator helpers for querying CPUID features

Add feature-specific helpers for querying guest CPUID support from the
emulator instead of having the emulator do a full CPUID and perform its
own bit tests.  The primary motivation is to eliminate the emulator's
usage of bit() so that future patches can add more extensive build-time
assertions on the usage of bit() without having to expose yet more code
to the emulator.

Note, providing a generic guest_cpuid_has() to the emulator doesn't work
due to the existing built-time assertions in guest_cpuid_has(), which
require the feature being checked to be a compile-time constant.

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c