From: Alexander Graf Subject: [PATCH 3/5] Don't #VMEXIT(INTR) if we still have event_inj waiting Date: Fri, 18 Sep 2009 15:00:30 +0200 Message-ID: <1253278832-31803-4-git-send-email-agraf@suse.de> 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> To: kvm@vger.kernel.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:49035 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753121AbZIRNA3 (ORCPT ); Fri, 18 Sep 2009 09:00:29 -0400 Received: from relay2.suse.de (relay-ext.suse.de [195.135.221.8]) by mx2.suse.de (Postfix) with ESMTP id 439CA86A2E for ; Fri, 18 Sep 2009 15:00:33 +0200 (CEST) In-Reply-To: <1253278832-31803-3-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Real hardware would first process the event_inj field and then notify the host that an interrupt is waiting. Let's do the same and just not EXIT_INTR if we have an event pending for the L2 guest. Signed-off-by: Alexander Graf --- arch/x86/kvm/svm.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) 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; + /* 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 = SVM_EXIT_INTR; if (nested_svm_exit_handled(svm)) { -- 1.6.0.2