Skip to contentSkip to conversation

nVMX: Fix erroneous exception bitmap check

PATCH Applied Nadav Har'El 2 participants 2 messages Mar 6, 2012 – Mar 7, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
 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           |
Applied
#1 lore raw
Quoted 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_VECTOR bit. 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