From patchwork Fri Sep 18 13:00:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 48531 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8ID0gJr022742 for ; Fri, 18 Sep 2009 13:00:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754940AbZIRNAc (ORCPT ); Fri, 18 Sep 2009 09:00:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755910AbZIRNAb (ORCPT ); Fri, 18 Sep 2009 09:00:31 -0400 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) From: Alexander Graf To: kvm@vger.kernel.org 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> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1253278832-31803-3-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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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)) {