Skip to content

Commit ee050a5

Browse files
sean-jcbonzini
authored andcommitted
KVM: nVMX: Truncate bits 63:32 of VMCS field on nested check in !64-bit
Drop bits 63:32 of the VMCS field encoding when checking for a nested VM-Exit on VMREAD/VMWRITE in !64-bit mode. VMREAD and VMWRITE always use 32-bit operands outside of 64-bit mode. The actual emulation of VMREAD/VMWRITE does the right thing, this bug is purely limited to incorrectly causing a nested VM-Exit if a GPR happens to have bits 63:32 set outside of 64-bit mode. Fixes: a7cde48 ("KVM: nVMX: Do not forward VMREAD/VMWRITE VMExits to L1 if required so by vmcs12 vmread/vmwrite bitmaps") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210422022128.3464144-6-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent d897134 commit ee050a5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/x86/kvm/vmx/nested.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5745,7 +5745,7 @@ static bool nested_vmx_exit_handled_vmcs_access(struct kvm_vcpu *vcpu,
57455745

57465746
/* Decode instruction info and find the field to access */
57475747
vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO);
5748-
field = kvm_register_read(vcpu, (((vmx_instruction_info) >> 28) & 0xf));
5748+
field = kvm_register_readl(vcpu, (((vmx_instruction_info) >> 28) & 0xf));
57495749

57505750
/* Out-of-range fields always cause a VM exit from L2 to L1 */
57515751
if (field >> 15)

0 commit comments

Comments
 (0)