From: Marcelo Tosatti <mtosatti@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [patch 2/2] acpi_piix4: expose no_hotplug attribute via i/o port
Date: Tue, 11 Jan 2011 14:25:01 -0200 [thread overview]
Message-ID: <20110111162501.GA8857@amt.cnet> (raw)
In-Reply-To: <20110110212548.GC30450@redhat.com>
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 <mtosatti@redhat.com>
> > Tested-by: Gleb Natapov <gleb@redhat.com>
> >
> > 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.
prev parent reply other threads:[~2011-01-11 16:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-10 18:55 [Qemu-devel] [patch 0/2] [pci branch] configure pci slot removability through ACPI Marcelo Tosatti
2011-01-10 18:55 ` [Qemu-devel] [patch 1/2] document QEMU<->ACPIBIOS PCI hotplug interface Marcelo Tosatti
2011-01-10 18:55 ` [Qemu-devel] [patch 2/2] acpi_piix4: expose no_hotplug attribute via i/o port Marcelo Tosatti
2011-01-10 21:25 ` [Qemu-devel] " Michael S. Tsirkin
2011-01-11 16:20 ` [Qemu-devel] [patch 0/2] [pci branch] configure pci slot removability through ACPI (v2) Marcelo Tosatti
2011-01-11 16:20 ` [Qemu-devel] [patch 1/2] document QEMU<->ACPIBIOS PCI hotplug interface Marcelo Tosatti
2011-01-17 14:36 ` [Qemu-devel] " Michael S. Tsirkin
2011-01-11 16:20 ` [Qemu-devel] [patch 2/2] acpi_piix4: expose no_hotplug attribute via i/o port Marcelo Tosatti
2011-01-11 16:25 ` Marcelo Tosatti [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110111162501.GA8857@amt.cnet \
--to=mtosatti@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).