From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: ioapic/msi interrupt delivery consolidation. Date: Wed, 11 Mar 2009 09:42:44 +0800 Message-ID: <200903110942.45123.sheng@linux.intel.com> References: <20090305143438.31443.51019.stgit@dhcp-1-237.tlv.redhat.com> <20090305143449.31443.29234.stgit@dhcp-1-237.tlv.redhat.com> <20090310165436.GA7375@silverwood.ncultra.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , avi@redhat.com, mtosatti@redhat.com To: kvm@vger.kernel.org, ncmike@ncultra.org Return-path: Received: from mga05.intel.com ([192.55.52.89]:45223 "EHLO fmsmga101.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754004AbZCKBmt (ORCPT ); Tue, 10 Mar 2009 21:42:49 -0400 In-Reply-To: <20090310165436.GA7375@silverwood.ncultra.org> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Wednesday 11 March 2009 00:54:37 Mike Day wrote: > On 05/03/09 16:34 +0200, Gleb Natapov wrote: > > ioapic_deliver() and kvm_set_msi() have code duplication. Move > > the code into ioapic_deliver_entry() function and call it from > > both places. > > > > > > +static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq) > > +{ > > + union kvm_ioapic_redirect_entry entry = ioapic->redirtbl[irq]; > > + > > + ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x " > > + "vector=%x trig_mode=%x\n", > > + entry.fields.dest, entry.fields.dest_mode, > > + entry.fields.delivery_mode, entry.fields.vector, > > + entry.fields.trig_mode); > > + > > +#ifdef CONFIG_X86 > > + /* Always delivery PIT interrupt to vcpu 0 */ > > + if (irq == 0) { > > + entry.fields.dest_mode = 0; /* Physical mode. */ > > + entry.fields.dest_id = ioapic->kvm->vcpus[0]->vcpu_id; > > + } > > +#endif > > + return ioapic_deliver_entry(ioapic->kvm, &entry); > > +} > > + > > Why is the PIT always handled by vcpu 0? > > thanks, Hi Mike This due to a timer bug, please google "The SMP RHEL 5.1 PAE guest can't boot up issue". (should be http://www.mail-archive.com/kvm- devel@lists.sourceforge.net/msg13250.html but damn it, seems I've blocked by Chinese GFW to get the page...) -- regards Yang, Sheng