All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lewis <aaronlewis@google.com>
To: kvm@vger.kernel.org
Cc: Janakarajan.Natarajan@amd.com, jmattson@google.com,
	Aaron Lewis <aaronlewis@google.com>
Subject: [Patch] KVM: SVM: Fix svm_xsaves_supported
Date: Tue,  3 Sep 2019 17:14:22 -0700	[thread overview]
Message-ID: <20190904001422.11809-1-aaronlewis@google.com> (raw)

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


             reply	other threads:[~2019-09-04  0:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  0:14 Aaron Lewis [this message]
2019-09-04 16:51 ` [Patch] KVM: SVM: Fix svm_xsaves_supported 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190904001422.11809-1-aaronlewis@google.com \
    --to=aaronlewis@google.com \
    --cc=Janakarajan.Natarajan@amd.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.