From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 4/4] Nested SVM: Improve interrupt injection v2 Date: Mon, 15 Jun 2009 14:56:10 +0300 Message-ID: <20090615115610.GP19508@redhat.com> References: <1242730443-15656-1-git-send-email-agraf@suse.de> <1242730443-15656-2-git-send-email-agraf@suse.de> <1242730443-15656-3-git-send-email-agraf@suse.de> <1242730443-15656-4-git-send-email-agraf@suse.de> <1242730443-15656-5-git-send-email-agraf@suse.de> <20090519132217.GF12080@redhat.com> <16F5B8F5-5F7D-4D3C-B33D-6C0369A6FD14@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, joerg.roedel@amd.com To: Alexander Graf Return-path: Received: from mx2.redhat.com ([66.187.237.31]:54740 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbZFOL4M (ORCPT ); Mon, 15 Jun 2009 07:56:12 -0400 Content-Disposition: inline In-Reply-To: <16F5B8F5-5F7D-4D3C-B33D-6C0369A6FD14@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jun 15, 2009 at 01:47:08PM +0200, Alexander Graf wrote: > > On 19.05.2009, at 15:22, Gleb Natapov wrote: > >> On Tue, May 19, 2009 at 12:54:03PM +0200, Alexander Graf wrote: >>> While trying to get Hyper-V running, I realized that the interrupt >>> injection >>> mechanisms that are in place right now are not 100% correct. >>> >>> This patch makes nested SVM's interrupt injection behave more like >>> on a >>> real machine. >>> >>> v2 calls BUG_ON when svm_set_irq is called with GIF=0 >>> >>> Signed-off-by: Alexander Graf >>> --- >>> arch/x86/kvm/svm.c | 39 ++++++++++++++++++++++++--------------- >>> 1 files changed, 24 insertions(+), 15 deletions(-) >>> >>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c >>> index fa2a710..5b14c9d 100644 >>> --- a/arch/x86/kvm/svm.c >>> +++ b/arch/x86/kvm/svm.c >>> @@ -1517,7 +1517,8 @@ static int nested_svm_vmexit_real(struct >>> vcpu_svm *svm, void *arg1, >>> /* Kill any pending exceptions */ >>> if (svm->vcpu.arch.exception.pending == true) >>> nsvm_printk("WARNING: Pending Exception\n"); >>> - svm->vcpu.arch.exception.pending = false; >>> + kvm_clear_exception_queue(&svm->vcpu); >>> + kvm_clear_interrupt_queue(&svm->vcpu); >>> >> What about pending NMI here? > > NMI injected to the guest? That should have triggered by now and caused > an #NMI exit, no? > I don't really understand what this code is doing, but there are three types of events exception/interrupt/nmi you clear only two of them. If you are sure this is correct then OK. -- Gleb.