]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: selftests: Use kvm_cpu_has() for XSAVE in cr4_cpuid_sync_test
authorSean Christopherson <seanjc@google.com>
Tue, 14 Jun 2022 20:06:37 +0000 (20:06 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 14 Jul 2022 01:14:12 +0000 (18:14 -0700)
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
tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c

index f4d3a042ec1c46889cf2e12400a8f7c73e5fa6db..611febdc2128c1bfc7069e08b3429775dae27343 100644 (file)
@@ -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);