From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 3/5] Don't #VMEXIT(INTR) if we still have event_inj waiting Date: Wed, 23 Sep 2009 03:39:23 +0200 Message-ID: <20090923013923.GD4654@8bytes.org> References: <1253278832-31803-1-git-send-email-agraf@suse.de> <1253278832-31803-2-git-send-email-agraf@suse.de> <1253278832-31803-3-git-send-email-agraf@suse.de> <1253278832-31803-4-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Alexander Graf Return-path: Received: from 8bytes.org ([88.198.83.132]:33134 "EHLO 8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752966AbZIWBjU (ORCPT ); Tue, 22 Sep 2009 21:39:20 -0400 Content-Disposition: inline In-Reply-To: <1253278832-31803-4-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 18, 2009 at 03:00:30PM +0200, Alexander Graf wrote: > Real hardware would first process the event_inj field and then notify= the > host that an interrupt is waiting. Does it really? I couldn't find this in the SVM spec. > Let's do the same and just not EXIT_INTR if we have an event pending = for the > L2 guest. Anyway. I think this case is handled good enough with patch 5/5. This patch, to be complete must also enable single-steping to exit again after the first instruction of the exception handler has ran to inject the interrupt. But that would make the whole thing rather comp=C4=BAica= ted. > Signed-off-by: Alexander Graf > --- > arch/x86/kvm/svm.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) >=20 > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 61efd13..28fcbd0 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -1401,6 +1401,10 @@ static inline int nested_svm_intr(struct vcpu_= svm *svm) > if (!(svm->vcpu.arch.hflags & HF_HIF_MASK)) > return 0; > =20 > + /* We can't EXIT_INTR when we still have an event to inject */ > + if (svm->vmcb->control.event_inj) > + return 1; > + > svm->vmcb->control.exit_code =3D SVM_EXIT_INTR; > =20 > if (nested_svm_exit_handled(svm)) { > --=20 > 1.6.0.2 >=20 > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html