]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: selftests: Drop manual XCR0 configuration from state test
authorSean Christopherson <seanjc@google.com>
Thu, 3 Oct 2024 23:43:35 +0000 (16:43 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 1 Nov 2024 16:26:35 +0000 (09:26 -0700)
Now that CR4.OSXSAVE and XCR0 are setup by default, drop the manual
enabling from the state test, which is fully redundant with the default
behavior.

Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/20241003234337.273364-10-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/state_test.c

index 1c756db329e5752163080af1117279477ef6368f..141b7fc0c965b34b4876d94818c2c00f993cc386 100644 (file)
@@ -145,11 +145,6 @@ static void __attribute__((__flatten__)) guest_code(void *arg)
 
                memset(buffer, 0xcc, sizeof(buffer));
 
-               set_cr4(get_cr4() | X86_CR4_OSXSAVE);
-               GUEST_ASSERT(this_cpu_has(X86_FEATURE_OSXSAVE));
-
-               xsetbv(0, xgetbv(0) | supported_xcr0);
-
                /*
                 * Modify state for all supported xfeatures to take them out of
                 * their "init" state, i.e. to make them show up in XSTATE_BV.