[SRU][J][PATCH 1/2] Revert "KVM: x86: Always enable legacy FP/SSE in allowed user XFEATURES"

Chengen Du chengen.du at canonical.com
Wed Sep 20 02:22:34 UTC 2023


BugLink: https://bugs.launchpad.net/bugs/2036675

commit a1020a25e69755a8a1a37735d674b91d6f02939f upstream.

This reverts commit fa9225d64f215e8109de10f6b6c7a08f033d0ec0.

Signed-off-by: Chengen Du <chengen.du at canonical.com>
---
 arch/x86/kvm/cpuid.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 5f83b3f2680e..89c1b78057e9 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -187,13 +187,7 @@ static void kvm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu)
 		best->ecx |= XFEATURE_MASK_FPSSE;
 	}
 
-	/*
-	 * FP+SSE can always be saved/restored via KVM_{G,S}ET_XSAVE, even if
-	 * XSAVE/XCRO are not exposed to the guest, and even if XSAVE isn't
-	 * supported by the host.
-	 */
-	vcpu->arch.guest_fpu.fpstate->user_xfeatures = vcpu->arch.guest_supported_xcr0 |
-						       XFEATURE_MASK_FPSSE;
+	vcpu->arch.guest_fpu.fpstate->user_xfeatures = vcpu->arch.guest_supported_xcr0;
 
 	kvm_update_pv_runtime(vcpu);
 
-- 
2.39.2




More information about the kernel-team mailing list