[SRU][FOCAL][PATCH 1/1] kvm: svm: Update svm_xsaves_supported

William Breathitt Gray william.gray at canonical.com
Tue Sep 15 20:53:48 UTC 2020

From: Aaron Lewis <aaronlewis at google.com>

AMD CPUs now support XSAVES in a limited fashion (they require IA32_XSS
to be zero).

AMD has no equivalent of Intel's "Enable XSAVES/XRSTORS" VM-execution
control. Instead, XSAVES is always available to the guest when supported
on the host.

Reviewed-by: Jim Mattson <jmattson at google.com>
Signed-off-by: Aaron Lewis <aaronlewis at google.com>
Change-Id: I40dc2c682eb0d38c2208d95d5eb7bbb6c47f6317
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
BugLink: https://bugs.launchpad.net/bugs/1887490
(cherry-picked from commit 52297436199dde85be557ee6bc779f5b96082f74)
Signed-off-by: William Breathitt Gray <william.gray at canonical.com>
 arch/x86/kvm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 3243a80ea32c..027004daec56 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -6019,7 +6019,7 @@ static bool svm_mpx_supported(void)
 static bool svm_xsaves_supported(void)
-	return false;
+	return boot_cpu_has(X86_FEATURE_XSAVES);
 static bool svm_umip_emulated(void)

More information about the kernel-team mailing list