diff options
author | Sean Christopherson <seanjc@google.com> | 2022-06-14 20:06:28 +0000 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2022-07-13 18:14:09 -0700 |
commit | 61d76b8a6943cd12b89029f9b04a75ce97f01d96 (patch) | |
tree | 108ff9d7c8abf748b80d22bd3902adc0f0425b7a /tools/testing/selftests/kvm/x86_64/smm_test.c | |
parent | 683edfd42bc222daf17388afb0c752e38712fa05 (diff) |
KVM: selftests: Add framework to query KVM CPUID bits
Add X86_FEATURE_* magic in the style of KVM-Unit-Tests' implementation,
where the CPUID function, index, output register, and output bit position
are embedded in the macro value. Add kvm_cpu_has() to query KVM's
supported CPUID and use it set_sregs_test, which is the most prolific
user of manual feature querying.
Opportunstically rename calc_cr4_feature_bits() to
calc_supported_cr4_feature_bits() to better capture how the CR4 bits are
chosen.
Link: https://lore.kernel.org/all/20210422005626.564163-1-ricarkol@google.com
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Suggested-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20220614200707.3315957-4-seanjc@google.com
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/smm_test.c')
0 files changed, 0 insertions, 0 deletions