From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH 08/11] KVM: nVMX: Fix erroneous exception bitmap check Date: Wed, 9 May 2012 16:10:44 +0300 Message-ID: <1336569047-23576-9-git-send-email-avi@redhat.com> References: <1336569047-23576-1-git-send-email-avi@redhat.com> Cc: Marcelo Tosatti , kvm@vger.kernel.org To: stable@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:63696 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756981Ab2EINL0 (ORCPT ); Wed, 9 May 2012 09:11:26 -0400 In-Reply-To: <1336569047-23576-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: From: 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. Signed-off-by: Nadav Har'El Reported-by: Dan Carpenter Signed-off-by: Avi Kivity (cherry picked from commit 9587190107d0c0cbaccbf7bf6b0245d29095a9ae) --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index fafb325..5d1b0c7 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1678,7 +1678,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); -- 1.7.10.1