All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch 1/6] KVM: VMX: Remove unneeded check for X86_FEATURE_XSAVE
@ 2019-10-09  0:41 Aaron Lewis
  2019-10-09  0:41 ` [Patch 2/6] KVM: VMX: Use wrmsr for switching between guest and host IA32_XSS Aaron Lewis
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Aaron Lewis @ 2019-10-09  0:41 UTC (permalink / raw)
  To: Babu Moger, Yang Weijiang, Sebastian Andrzej Siewior, kvm
  Cc: Paolo Bonzini, Aaron Lewis, Jim Mattson

The SDM says that IA32_XSS is supported "If(CPUID.(0DH, 1):EAX.[3] = 1",
so only the X86_FEATURE_XSAVES check is necessary.

Fixes: 4d763b168e9c5 ("KVM: VMX: check CPUID before allowing read/write of IA32_XSS")
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Aaron Lewis <aaronlewis@google.com>
---
 arch/x86/kvm/vmx/vmx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index e7970a2e8eae..409e9a7323f1 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -1823,8 +1823,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 	case MSR_IA32_XSS:
 		if (!vmx_xsaves_supported() ||
 		    (!msr_info->host_initiated &&
-		     !(guest_cpuid_has(vcpu, X86_FEATURE_XSAVE) &&
-		       guest_cpuid_has(vcpu, X86_FEATURE_XSAVES))))
+		     !guest_cpuid_has(vcpu, X86_FEATURE_XSAVES)))
 			return 1;
 		msr_info->data = vcpu->arch.ia32_xss;
 		break;
@@ -2066,8 +2065,7 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 	case MSR_IA32_XSS:
 		if (!vmx_xsaves_supported() ||
 		    (!msr_info->host_initiated &&
-		     !(guest_cpuid_has(vcpu, X86_FEATURE_XSAVE) &&
-		       guest_cpuid_has(vcpu, X86_FEATURE_XSAVES))))
+		     !guest_cpuid_has(vcpu, X86_FEATURE_XSAVES)))
 			return 1;
 		/*
 		 * The only supported bit as of Skylake is bit 8, but
-- 
2.23.0.581.g78d2f28ef7-goog


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

end of thread, other threads:[~2019-10-10 16:04 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09  0:41 [Patch 1/6] KVM: VMX: Remove unneeded check for X86_FEATURE_XSAVE Aaron Lewis
2019-10-09  0:41 ` [Patch 2/6] KVM: VMX: Use wrmsr for switching between guest and host IA32_XSS Aaron Lewis
2019-10-09  4:49   ` Yang Weijiang
2019-10-09  6:30   ` Paolo Bonzini
2019-10-09 12:34     ` Vitaly Kuznetsov
2019-10-09  6:31   ` Sebastian Andrzej Siewior
2019-10-09  0:41 ` [Patch 3/6] kvm: svm: Add support for XSAVES on AMD Aaron Lewis
2019-10-09  6:44   ` Sebastian Andrzej Siewior
2019-10-10 14:42     ` Aaron Lewis
2019-10-10 16:04       ` Paolo Bonzini
2019-10-09  7:01   ` Paolo Bonzini
2019-10-09 21:29     ` Jim Mattson
2019-10-09 21:40       ` Paolo Bonzini
2019-10-09 21:58         ` Jim Mattson
2019-10-09 22:49           ` Paolo Bonzini
2019-10-10  0:42             ` Kang, Luwei
2019-10-09  0:41 ` [Patch 4/6] kvm: svm: Enumerate XSAVES in guest CPUID when it is available to the guest Aaron Lewis
2019-10-09  1:42   ` Yang Weijiang
2019-10-09  6:32     ` Paolo Bonzini
2019-10-09 23:35       ` Jim Mattson
2019-10-09  0:41 ` [Patch 5/6] kvm: x86: Add IA32_XSS to the emulated_msrs list Aaron Lewis
2019-10-09  0:41 ` [Patch 6/6] kvm: tests: Add test to verify MSR_IA32_XSS Aaron Lewis
2019-10-09  6:30   ` Paolo Bonzini
2019-10-09 23:44     ` Jim Mattson
2019-10-10 16:01       ` Paolo Bonzini

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.