]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Rework OSXSAVE CR4=>CPUID test to play nice with AVX insns
authorSean Christopherson <seanjc@google.com>
Thu, 3 Oct 2024 23:43:30 +0000 (16:43 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 1 Nov 2024 16:26:30 +0000 (09:26 -0700)
commit2b9a126a2986fef604275d7d198163c9c3ced172
treeb44d0168fae41fa9ce05d80a1b2e9132e731f14c
parent164cea33bfedf883651d8d8b2db2fa867b48ecb0
KVM: selftests: Rework OSXSAVE CR4=>CPUID test to play nice with AVX insns

Rework the CR4/CPUID sync test to clear CR4.OSXSAVE, do CPUID, and restore
CR4.OSXSAVE in assembly, so that there is zero chance of AVX instructions
being executed while CR4.OSXSAVE is disabled.  This will allow enabling
CR4.OSXSAVE by default for selftests vCPUs as a general means of playing
nice with AVX instructions.

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