All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] KVM: SVM: Fix svm_xsaves_supported
@ 2019-09-04  0:14 Aaron Lewis
  2019-09-04 16:51 ` Vitaly Kuznetsov
  0 siblings, 1 reply; 9+ messages in thread
From: Aaron Lewis @ 2019-09-04  0:14 UTC (permalink / raw)
  To: kvm; +Cc: Janakarajan.Natarajan, jmattson, Aaron Lewis

AMD allows guests to execute XSAVES/XRSTORS if supported by the host.  This is different than Intel as they have an additional control bit that determines if XSAVES/XRSTORS can be used by the guest. Intel also has intercept bits that might prevent the guest from intercepting the instruction as well. AMD has none of that, not even an Intercept mechanism.  AMD simply allows XSAVES/XRSTORS to be executed by the guest if also supported by the host.

Signed-off-by: Aaron Lewis <aaronlewis@google.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 1f220a85514f..b681a89f4f7e 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -5985,7 +5985,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)
-- 
2.23.0.187.g17f5b7556c-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-10-03 17:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04  0:14 [Patch] KVM: SVM: Fix svm_xsaves_supported Aaron Lewis
2019-09-04 16:51 ` Vitaly Kuznetsov
2019-09-04 19:03   ` Aaron Lewis
2019-09-05 12:46     ` Vitaly Kuznetsov
2019-09-06 17:55   ` Jim Mattson
2019-09-09  8:54     ` Vitaly Kuznetsov
2019-10-03 16:02       ` Moger, Babu
2019-10-03 16:15         ` Jim Mattson
2019-10-03 16:20           ` Moger, Babu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.