From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] various fixes for CPU/PCI hotplug Date: Tue, 3 Feb 2009 22:27:58 +0200 Message-ID: <20090203202758.GD29674@redhat.com> References: <20090203140129.GC30234@redhat.com> <5d6222a80902031058y545c6676v17ff99747fa0423e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, glommer@redhat.com, kvm@vger.kernel.org To: Glauber Costa Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39684 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbZBCUa2 (ORCPT ); Tue, 3 Feb 2009 15:30:28 -0500 Content-Disposition: inline In-Reply-To: <5d6222a80902031058y545c6676v17ff99747fa0423e@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Feb 03, 2009 at 04:58:31PM -0200, Glauber Costa wrote: > > > > void qemu_system_device_hot_add(int pcibus, int slot, int state) > > { > > - qemu_set_irq(pm_state->irq, 1); > > pci0_status.up = 0; > > pci0_status.down = 0; > > if (state) > > enable_device(&pci0_status, &gpe, slot); > > else > > disable_device(&pci0_status, &gpe, slot); > > - qemu_set_irq(pm_state->irq, 0); > > + > > + if (gpe.en & 2) { > > + qemu_set_irq(pm_state->irq, 1); > > + qemu_set_irq(pm_state->irq, 0); > > + } > > } > > Are you sure this works? The trigger is now happening after all the > events take place. It might well work depending on how qemu exposes > this, but I have some spare memories of having problems with this in > the past. > >>From my limited testing it works and I don't see why it shoudn't. What do you think can go wrong? Actually triggering an interrupt before programming status looks suspicious to me. -- Gleb.