From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF0c3-0005at-52 for qemu-devel@nongnu.org; Tue, 03 Apr 2012 06:05:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SF0bw-0000S4-6y for qemu-devel@nongnu.org; Tue, 03 Apr 2012 06:05:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF0bv-0000Rt-UY for qemu-devel@nongnu.org; Tue, 03 Apr 2012 06:05:12 -0400 Date: Tue, 3 Apr 2012 13:05:15 +0300 From: "Michael S. Tsirkin" Message-ID: <20120403100515.GA9697@redhat.com> References: <1333393194.3799.175.camel@bling.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCHv3] piix: fix up/down races List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Anthony Liguori , gleb@redhat.com, qemu-devel@nongnu.org, Isaku Yamahata , Alex Williamson , Gerd Hoffmann , Paolo Bonzini , Aurelien Jarno On Tue, Apr 03, 2012 at 02:40:41AM -0400, Igor Mammedov wrote: > > > + */ > > > + s->pci0_status.down &= ~(1U << slot); > > > > Should we clear "up" here too? > Is it possible to create pci dev for not yet freed pci slot? It's not possible ATM. > If not then we should not care, otherwise we should fix that. > > > @@ -567,8 +595,6 @@ static int piix4_device_hotplug(DeviceState > > > *qdev, PCIDevice *dev, > > > return 0; > > > } > > > > > > - s->pci0_status.up = 0; > > > - s->pci0_status.down = 0; > > > if (state == PCI_HOTPLUG_ENABLED) { > > > enable_device(s, slot); > > > } else { > > > > So if we have an old bios and do an add, followed by a remove, guest > > ACPI finds both "up" and "down" set for the slot and we rely on the > > ordering of the AML checking up before down to keep the duct tape and > > bailing wire from exploding? In fact UP triggers a rescan - there is no injection event in ACPI. So it seems you can check the events in any order. > > Hmm, can't say I'm excited about this > > hack > > either. Thanks, > > > > Alex > > > >