Commit 045520e4 authored by Sean Christopherson's avatar Sean Christopherson
Browse files

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: default avatarSean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20220614200707.3315957-13-seanjc@google.com
parent 8fea056e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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);