From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47129 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pch4M-000432-CJ for qemu-devel@nongnu.org; Tue, 11 Jan 2011 11:29:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pch2Z-0002lf-GA for qemu-devel@nongnu.org; Tue, 11 Jan 2011 11:27:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pch2Z-0002lD-6c for qemu-devel@nongnu.org; Tue, 11 Jan 2011 11:25:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0BGPj3Q017666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Jan 2011 11:25:46 -0500 Date: Tue, 11 Jan 2011 14:25:01 -0200 From: Marcelo Tosatti Subject: Re: [Qemu-devel] Re: [patch 2/2] acpi_piix4: expose no_hotplug attribute via i/o port Message-ID: <20110111162501.GA8857@amt.cnet> References: <20110110185501.493193296@redhat.com> <20110110185906.946280027@redhat.com> <20110110212548.GC30450@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110110212548.GC30450@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org On Mon, Jan 10, 2011 at 11:25:48PM +0200, Michael S. Tsirkin wrote: > On Mon, Jan 10, 2011 at 04:55:03PM -0200, Marcelo Tosatti wrote: > > Expose no_hotplug attribute via I/O port, so ACPI BIOS can indicate > > removability status to guest OS. > > > > An updated seabios is required to make use of this feature (seabios.git > > commit ID 3c241edf3d7ef29c21). > > > > Signed-off-by: Marcelo Tosatti > > Tested-by: Gleb Natapov > > > > Index: qemu/hw/acpi_piix4.c > > =================================================================== > > --- qemu.orig/hw/acpi_piix4.c > > +++ qemu/hw/acpi_piix4.c > > @@ -37,6 +37,7 @@ > > #define GPE_BASE 0xafe0 > > #define PCI_BASE 0xae00 > > #define PCI_EJ_BASE 0xae08 > > +#define PCI_RMV_BASE 0xae0c > > > > #define PIIX4_PCI_HOTPLUG_STATUS 2 > > > > @@ -73,6 +74,7 @@ typedef struct PIIX4PMState { > > /* for pci hotplug */ > > struct gpe_regs gpe; > > struct pci_status pci0_status; > > + uint32_t pci0_hotplug_enable; > > } PIIX4PMState; > > > > static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s); > > @@ -322,6 +324,25 @@ static const VMStateDescription vmstate_ > > } > > }; > > > > +static void piix4_update_hotplug(PIIX4PMState *s) > > +{ > > + PCIDevice *dev = &s->dev; > > + BusState *bus = qdev_get_parent_bus(&dev->qdev); > > + DeviceState *qdev, *next; > > + > > + s->pci0_hotplug_enable = 0; > > + > > + QLIST_FOREACH_SAFE(qdev, &bus->children, sibling, next) { > > + PCIDeviceInfo *info = container_of(qdev->info, PCIDeviceInfo, qdev); > > + PCIDevice *pdev = DO_UPCAST(PCIDevice, qdev, qdev); > > + int slot = PCI_SLOT(pdev->devfn); > > + > > + if (!info->no_hotplug) { > > + s->pci0_hotplug_enable |= (1 << slot); > > + } > > + } > > +} > > + > > So a slot starts as non-removable and becomes removable when you add a > hotpluggable device? Isn't this a bit strange? > I would say all slots should be removable unless there's a > non hotpluggable device there ... Ugh, thats right, thanks.