Skip to content

Commit

Permalink
KVM: nVMX: Fix erroneous exception bitmap check
Browse files Browse the repository at this point in the history
The code which checks whether to inject a pagefault to L1 or L2 (in
nested VMX) was wrong, incorrect in how it checked the PF_VECTOR bit.
Thanks to Dan Carpenter for spotting this.

Signed-off-by: Nadav Har'El <nyh@il.ibm.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Nadav Har'El authored and Avi Kivity committed Mar 8, 2012
1 parent a223c31 commit 9587190
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ static int nested_pf_handled(struct kvm_vcpu *vcpu)
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);

/* TODO: also check PFEC_MATCH/MASK, not just EB.PF. */
if (!(vmcs12->exception_bitmap & PF_VECTOR))
if (!(vmcs12->exception_bitmap & (1u << PF_VECTOR)))
return 0;

nested_vmx_vmexit(vcpu);
Expand Down

0 comments on commit 9587190

Please sign in to comment.