blob: 8ea76a0ba426ddaa2c18093269804e8a572696d6 [file] [log] [blame]
From stable-owner@vger.kernel.org Wed May 9 06:14:29 2012
From: Avi Kivity <avi@redhat.com>
Date: Wed, 9 May 2012 16:10:44 +0300
Subject: KVM: nVMX: Fix erroneous exception bitmap check
To: stable@vger.kernel.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Message-ID: <1336569047-23576-9-git-send-email-avi@redhat.com>
From: Nadav Har'El <nyh@math.technion.ac.il>
(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 <nyh@il.ibm.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1678,7 +1678,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);