diff options
| author | Sean Christopherson <seanjc@google.com> | 2022-06-14 20:06:59 +0000 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2022-07-13 18:14:22 -0700 |
| commit | 05c2b6e5facc4f04e4df0cfedbcc8943318ed983 (patch) | |
| tree | c0d695256cf4c37528c5dff36287fd18d84b610d /tools/testing/selftests/kvm/include | |
| parent | 2b424a76d02cf6f8d94eeb253b1c0e4327b1718a (diff) | |
| download | linux-05c2b6e5facc4f04e4df0cfedbcc8943318ed983.tar.gz linux-05c2b6e5facc4f04e4df0cfedbcc8943318ed983.tar.bz2 linux-05c2b6e5facc4f04e4df0cfedbcc8943318ed983.zip | |
KVM: selftests: Use this_cpu_has() to detect SVM support in L1
Replace an evil open coded instance of querying CPUID from L1 with
this_cpu_has(X86_FEATURE_SVM).
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20220614200707.3315957-35-seanjc@google.com
Diffstat (limited to 'tools/testing/selftests/kvm/include')
| -rw-r--r-- | tools/testing/selftests/kvm/include/x86_64/svm_util.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/tools/testing/selftests/kvm/include/x86_64/svm_util.h b/tools/testing/selftests/kvm/include/x86_64/svm_util.h index f48806d26989..a339b537a575 100644 --- a/tools/testing/selftests/kvm/include/x86_64/svm_util.h +++ b/tools/testing/selftests/kvm/include/x86_64/svm_util.h @@ -13,9 +13,6 @@ #include "svm.h" #include "processor.h" -#define CPUID_SVM_BIT 2 -#define CPUID_SVM BIT_ULL(CPUID_SVM_BIT) - #define SVM_EXIT_EXCP_BASE 0x040 #define SVM_EXIT_HLT 0x078 #define SVM_EXIT_MSR 0x07c @@ -52,16 +49,6 @@ struct svm_test_data *vcpu_alloc_svm(struct kvm_vm *vm, vm_vaddr_t *p_svm_gva); void generic_svm_setup(struct svm_test_data *svm, void *guest_rip, void *guest_rsp); void run_guest(struct vmcb *vmcb, uint64_t vmcb_gpa); -static inline bool cpu_has_svm(void) -{ - u32 eax = 0x80000001, ecx; - - asm("cpuid" : - "=a" (eax), "=c" (ecx) : "0" (eax) : "ebx", "edx"); - - return ecx & CPUID_SVM; -} - int open_sev_dev_path_or_exit(void); #endif /* SELFTEST_KVM_SVM_UTILS_H */ |
