kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kvm: nVMX: Enforce must-be-zero bits in the IA32_VMX_VMCS_ENUM MSR
@ 2019-05-31 18:41 Aaron Lewis
  2019-06-04 17:52 ` Krish Sadhukhan
  0 siblings, 1 reply; 4+ messages in thread
From: Aaron Lewis @ 2019-05-31 18:41 UTC (permalink / raw)
  To: jmattson, pshier, marcorr, kvm; +Cc: Aaron Lewis

According to the SDM, bit 0 and bits 63:10 of the IA32_VMX_VMCS_ENUM
MSR are reserved and are read as 0.

Signed-off-by: Aaron Lewis <aaronlewis@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/vmx/nested.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 6401eb7ef19c..3438279e76bb 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -1219,6 +1219,8 @@ int vmx_set_vmx_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
 	case MSR_IA32_VMX_EPT_VPID_CAP:
 		return vmx_restore_vmx_ept_vpid_cap(vmx, data);
 	case MSR_IA32_VMX_VMCS_ENUM:
+		if (data & (GENMASK_ULL(63, 10) | BIT_ULL(0)))
+			return -EINVAL;
 		vmx->nested.msrs.vmcs_enum = data;
 		return 0;
 	default:
-- 
2.22.0.rc1.311.g5d7573a151-goog


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31 18:41 [PATCH 1/2] kvm: nVMX: Enforce must-be-zero bits in the IA32_VMX_VMCS_ENUM MSR Aaron Lewis
2019-06-04 17:52 ` Krish Sadhukhan
2019-06-18 14:15   ` Aaron Lewis
2019-07-10 16:08     ` Aaron Lewis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).