From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [RFC][PATCH 3/3] In DM_LOWEST, only deliver interrupts to vcpus with enabled LAPIC's Date: Wed, 9 Jun 2010 14:20:27 +0300 Message-ID: <20100609112027.GZ14316@redhat.com> References: <1276019703-18136-1-git-send-email-clalance@redhat.com> <1276019703-18136-4-git-send-email-clalance@redhat.com> <20100609110132.GX14316@redhat.com> <4C0F762F.2030605@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Chris Lalancette , kvm@vger.kernel.org, mtosatti@redhat.com To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21062 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753764Ab0FILU3 (ORCPT ); Wed, 9 Jun 2010 07:20:29 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o59BKSel019774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Jun 2010 07:20:28 -0400 Content-Disposition: inline In-Reply-To: <4C0F762F.2030605@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jun 09, 2010 at 02:08:31PM +0300, Avi Kivity wrote: > On 06/09/2010 02:01 PM, Gleb Natapov wrote: > >On Tue, Jun 08, 2010 at 01:55:03PM -0400, Chris Lalancette wrote: > >>Otherwise we might try to deliver a timer interrupt to a cpu that > >>can't possibly handle it. > >> > >>Signed-off-by: Chris Lalancette > >>--- > >> virt/kvm/irq_comm.c | 2 +- > >> 1 files changed, 1 insertions(+), 1 deletions(-) > >> > >>diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c > >>index 52f412f..06cf61e 100644 > >>--- a/virt/kvm/irq_comm.c > >>+++ b/virt/kvm/irq_comm.c > >>@@ -100,7 +100,7 @@ int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src, > >> if (r< 0) > >> r = 0; > >> r += kvm_apic_set_irq(vcpu, irq); > >>- } else { > >>+ } else if (kvm_lapic_enabled(vcpu)) { > >> if (!lowest) > >> lowest = vcpu; > >> else if (kvm_apic_compare_prio(vcpu, lowest)< 0) > >Shouldn't we check kvm_lapic_enabled(vcpu) at the beginning of the loop? > >Something like: > > if (!kvm_apic_present(vcpu) || !kvm_lapic_enabled(vcpu)) > > continue; > > > > The apic still accepts some interrupts even if disabled, so this > needs to be very conditional. > What kind of interrupt and can they be delivered in DM_LOWEST mode? -- Gleb.