nVMX: Fix erroneous exception bitmap check
PATCH 1/1 nVMX: Fix erroneous exception bitmap check
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 <[email protected]>
Reported-by Dan Carpenter <[email protected]>
--- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/vmx.c 2012-03-06 16:31:25.000000000 +0200 renamed from arch/x86/kvm/vmx.c 2012-03-06 16:31:25.000000000 +0200 +1 -1
@@ -1664,7 +1664,7 @@ static int nested_pf_handled(struct kvm_ 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);
Signature · 4 lines
Nadav Har'El | Tuesday, Mar 6 2012, [email protected] |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |This box was intentionally left blank. http://nadav.harel.org.il |
Avi Kivity
AppliedQuoted 5 lines · Nadav Har'El
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_VECTORbit. Thanks to Dan Carpenter for spotting this.
Thanks, applied. The patch was whitespace-mangled, please watch out for this in the future.
Signature · 1 line
error compiling committee.c: too many arguments to function