Skip to content

Commit 567926c

Browse files
Sean Christophersonbonzini
authored andcommitted
KVM: nVMX: Fix consistency check on injected exception error code
Current versions of Intel's SDM incorrectly state that "bits 31:15 of the VM-Entry exception error-code field" must be zero. In reality, bits 31:16 must be zero, i.e. error codes are 16-bit values. The bogus error code check manifests as an unexpected VM-Entry failure due to an invalid code field (error number 7) in L1, e.g. when injecting a #GP with error_code=0x9f00. Nadav previously reported the bug[*], both to KVM and Intel, and fixed the associated kvm-unit-test. [*] https://patchwork.kernel.org/patch/11124749/ Reported-by: Nadav Amit <[email protected]> Cc: [email protected] Signed-off-by: Sean Christopherson <[email protected]> Reviewed-by: Jim Mattson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent d53a4c8 commit 567926c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/vmx/nested.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ static int nested_check_vm_entry_controls(struct kvm_vcpu *vcpu,
26102610

26112611
/* VM-entry exception error code */
26122612
if (CC(has_error_code &&
2613-
vmcs12->vm_entry_exception_error_code & GENMASK(31, 15)))
2613+
vmcs12->vm_entry_exception_error_code & GENMASK(31, 16)))
26142614
return -EINVAL;
26152615

26162616
/* VM-entry interruption-info field: reserved bits */

0 commit comments

Comments
 (0)