Commit b9c523c8 authored by Nadav Har'El's avatar Nadav Har'El Committed by Ben Hutchings

KVM: nVMX: Fix erroneous exception bitmap check

(cherry picked from commit 95871901)

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: default avatarNadav Har'El <nyh@il.ibm.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 50fcec93
...@@ -1677,7 +1677,7 @@ static int nested_pf_handled(struct kvm_vcpu *vcpu) ...@@ -1677,7 +1677,7 @@ static int nested_pf_handled(struct kvm_vcpu *vcpu)
struct vmcs12 *vmcs12 = get_vmcs12(vcpu); struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
/* TODO: also check PFEC_MATCH/MASK, not just EB.PF. */ /* 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; return 0;
nested_vmx_vmexit(vcpu); nested_vmx_vmexit(vcpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment