From: Nadav Har'El Date: Tue, 6 Mar 2012 14:39:22 +0000 (+0200) Subject: KVM: nVMX: Fix erroneous exception bitmap check X-Git-Tag: v3.2.19~113 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b9c523c841fd2e14602d144f3259c0fefe2c0da6;p=karo-tx-linux.git KVM: nVMX: Fix erroneous exception bitmap check (cherry picked from commit 9587190107d0c0cbaccbf7bf6b0245d29095a9ae) 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 Reported-by: Dan Carpenter Signed-off-by: Avi Kivity Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ben Hutchings --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4ea76784fe65..7ac59930d40e 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1677,7 +1677,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);