diff options
author | Sean Christopherson <seanjc@google.com> | 2024-10-04 01:43:33 +0200 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-11-01 17:26:33 +0100 |
commit | 3678c7f6114f6fc8614c7e9a249d60f8e1678bad (patch) | |
tree | 737ad8e9a2a20cc0bd52c336aff4e5105711149f /tools/testing/selftests | |
parent | KVM: selftests: Verify XCR0 can be "downgraded" and "upgraded" (diff) | |
download | linux-3678c7f6114f6fc8614c7e9a249d60f8e1678bad.tar.xz linux-3678c7f6114f6fc8614c7e9a249d60f8e1678bad.zip |
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 <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/20241003234337.273364-8-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c | 7 |
1 files changed, 2 insertions, 5 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 da818afb7031..28cc66454601 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 @@ -27,12 +27,9 @@ static void guest_code(void) [KVM_CPUID_EAX] = X86_FEATURE_OSXSAVE.function, [KVM_CPUID_ECX] = X86_FEATURE_OSXSAVE.index, }; - uint64_t cr4; - /* turn on CR4.OSXSAVE */ - cr4 = get_cr4(); - cr4 |= X86_CR4_OSXSAVE; - set_cr4(cr4); + /* CR4.OSXSAVE should be enabled by default (for selftests vCPUs). */ + GUEST_ASSERT(get_cr4() & X86_CR4_OSXSAVE); /* verify CR4.OSXSAVE == CPUID.OSXSAVE */ GUEST_ASSERT(this_cpu_has(X86_FEATURE_OSXSAVE)); |