Skip to content

Commit 3678c7f

Browse files
committed
KVM: selftests: Drop manual CR4.OSXSAVE enabling from CR4/CPUID sync test
Now that CR4.OSXSAVE is enabled by default, drop the manual enabling from CR4/CPUID sync test and instead assert that CR4.OSXSAVE is enabled. Reviewed-by: Vitaly Kuznetsov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 8ae01bf commit 3678c7f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ static void guest_code(void)
2727
[KVM_CPUID_EAX] = X86_FEATURE_OSXSAVE.function,
2828
[KVM_CPUID_ECX] = X86_FEATURE_OSXSAVE.index,
2929
};
30-
uint64_t cr4;
3130

32-
/* turn on CR4.OSXSAVE */
33-
cr4 = get_cr4();
34-
cr4 |= X86_CR4_OSXSAVE;
35-
set_cr4(cr4);
31+
/* CR4.OSXSAVE should be enabled by default (for selftests vCPUs). */
32+
GUEST_ASSERT(get_cr4() & X86_CR4_OSXSAVE);
3633

3734
/* verify CR4.OSXSAVE == CPUID.OSXSAVE */
3835
GUEST_ASSERT(this_cpu_has(X86_FEATURE_OSXSAVE));

0 commit comments

Comments
 (0)