From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 3/4] KVM: nVMX: Check all exceptions for intercept during delivery to L2 Date: Wed, 25 Sep 2013 14:52:14 +0300 Message-ID: <20130925115214.GJ1445@redhat.com> References: <1380102696-25267-1-git-send-email-gleb@redhat.com> <1380102696-25267-4-git-send-email-gleb@redhat.com> <5242BD1C.1020903@redhat.com> <20130925110012.GH1445@redhat.com> <5242C833.80609@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9056 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755000Ab3IYLwQ (ORCPT ); Wed, 25 Sep 2013 07:52:16 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8PBqGKN005330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Sep 2013 07:52:16 -0400 Content-Disposition: inline In-Reply-To: <5242C833.80609@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Sep 25, 2013 at 01:25:39PM +0200, Paolo Bonzini wrote: > Il 25/09/2013 13:00, Gleb Natapov ha scritto: > >>> > > @@ -1921,8 +1920,7 @@ static void vmx_queue_exception(struct kvm_vcpu *vcpu, unsigned nr, > >>> > > struct vcpu_vmx *vmx = to_vmx(vcpu); > >>> > > u32 intr_info = nr | INTR_INFO_VALID_MASK; > >>> > > > >>> > > - if (!reinject && nr == PF_VECTOR && is_guest_mode(vcpu) && > >>> > > - !vmx->nested.nested_run_pending && nested_pf_handled(vcpu)) > >>> > > + if (!reinject && is_guest_mode(vcpu) && nested_ex_handled(vcpu, nr)) > >> > > >> > The code is now pretty similar to what svm.c does. Do we want to move > >> > the is_guest_mode(vcpu) check into nested_ex_handled, too? (Or vice > >> > versa, take it out in svm.c). Perhaps you could also name the function > >> > nested_vmx_check_exception. > >> > > > I want to try to move the logic into common code eventually. I do not > > mind renaming for now, but it will have to wait for the next week :) > > I can rename while applying the patch. Making more logic common to vmx > and svm can wait. > Yes, of course, logic unification is not for the immediate feature. -- Gleb.