summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-06-14 20:06:37 +0000
committerSean Christopherson <seanjc@google.com>2022-07-13 18:14:12 -0700
commit045520e4755bbdf2f2983309c8eab6176a97a13d (patch)
tree9f0080abd684c1b0c3472b30f1cdbd411dbbfa15
parent8fea056eeb0c4840593bf2ed1e4cab5030d0b5b5 (diff)
KVM: selftests: Use kvm_cpu_has() for XSAVE in cr4_cpuid_sync_test
Use kvm_cpu_has() in the CR4/CPUID sync test instead of open coding equivalent functionality using kvm_get_supported_cpuid_entry(). No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20220614200707.3315957-13-seanjc@google.com
-rw-r--r--tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c b/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
index f4d3a042ec1c..611febdc2128 100644
--- a/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
+++ b/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
@@ -63,11 +63,9 @@ int main(int argc, char *argv[])
struct kvm_run *run;
struct kvm_vm *vm;
struct kvm_sregs sregs;
- struct kvm_cpuid_entry2 *entry;
struct ucall uc;
- entry = kvm_get_supported_cpuid_entry(1);
- TEST_REQUIRE(entry->ecx & CPUID_XSAVE);
+ TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_XSAVE));
/* Tell stdout not to buffer its content */
setbuf(stdout, NULL);