From: Nadav Har'El Subject: [PATCH] nVMX: Fix erroneous exception bitmap check Date: Tue, 6 Mar 2012 16:39:22 +0200 Message-ID: <20120306143922.GA11114@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:53497 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030750Ab2CFOji (ORCPT ); Tue, 6 Mar 2012 09:39:38 -0500 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: 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 --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- .before/arch/x86/kvm/vmx.c 2012-03-06 16:31:25.000000000 +0200 +++ .after/arch/x86/kvm/vmx.c 2012-03-06 16:31:25.000000000 +0200 @@ -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); -- Nadav Har'El | Tuesday, Mar 6 2012, nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |This box was intentionally left blank. http://nadav.harel.org.il |