From: Gleb Natapov <gleb@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: aliguori@us.ibm.com, mst@redhat.com, jbaron@redhat.com,
qemu-devel@nongnu.org, yamahata@valinux.co.jp, kraxel@redhat.com,
pbonzini@redhat.com, imammedo@redhat.com, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 0/5] PCI hotplug fixes/cleanup
Date: Thu, 5 Apr 2012 14:32:29 +0300 [thread overview]
Message-ID: <20120405113229.GH11204@redhat.com> (raw)
In-Reply-To: <20120405050848.31461.10826.stgit@bling.home>
On Wed, Apr 04, 2012 at 11:51:00PM -0600, Alex Williamson wrote:
> We've been batting this one back and forth. This series includes
> several of the cleanups and specification clarifications from my
> series awhile back. Patch 5 is my proposed alternative to
> Michael's PCI hotplug race fix. Since that version I added slot
> present tracking so we can be a little more strategic about which
> slots we ask the guest to check. The approach for that path is
> described in the commit log. I tested hotplug on both Linux an
> Windows guests (XP + 2k8), intentionally trying to do back to back
> device_add and device_del to get a race, but couldn't (I did
> however get a glibc double free that seems unrelated to this
> series).
>
> Long term I'd like to deprecate the up/down PCI hotplug interface
> and move to a new model. I think perhaps we should define 3 new
> registers:
>
> 1) Device present in slot bitmap (foundation already in 5/5 here)
> 2) Virtual slot power state bitmap
> 3) Requested slot date bitmap
>
> With these we should be able to do proper _STA, _PS0, and _PS3.
> We'd maintain the eject register for _EJ0, but deprecate up/down.
>
> For a device_add, the 'present' & 'request' bitmaps gets set for
> the slot by qemu, gpe.sts set and SCI interrupt sent. The OSPM
> can simply compare requested state vs power state and send the
> appropriate notify. Same general idea for removal. _STA can be
> formed by looking at the 'present' and 'power' bitmaps, and
> _PS0/3 perform writes to the power register to indicate the virtual
> state. I think this provides a better register ownership model
> (qemu owns present/request, OSPM owns power) and also allows us
> to differentiate between a guest initiated remove and a platform
> (vm manager) initiated remove so we can avoid changing the vm
> state in the former case. I'll try to send a patch for this out
> soon, but let me know if there are any concerns or suggestions for
> a redesign. Thanks,
>
> Alex
>
Acked-by: Gleb Natapov <gleb@redhat.com>
> ---
>
> Alex Williamson (5):
> acpi_piix4: Fix PCI hotplug race
> acpi_piix4: Remove PCI_RMV_BASE write code
> acpi_piix4: Use pci_get/set_byte
> acpi_piix4: Only allow writes to PCI hotplug eject register
> acpi_piix4: Disallow write to up/down PCI hotplug registers
>
>
> docs/specs/acpi_pci_hotplug.txt | 8 +-
> hw/acpi_piix4.c | 178 ++++++++++++++++++++-------------------
> 2 files changed, 95 insertions(+), 91 deletions(-)
--
Gleb.
next prev parent reply other threads:[~2012-04-05 11:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 5:51 [Qemu-devel] [PATCH 0/5] PCI hotplug fixes/cleanup Alex Williamson
2012-04-05 5:51 ` [Qemu-devel] [PATCH 1/5] acpi_piix4: Disallow write to up/down PCI hotplug registers Alex Williamson
2012-04-05 5:51 ` [Qemu-devel] [PATCH 2/5] acpi_piix4: Only allow writes to PCI hotplug eject register Alex Williamson
2012-04-05 8:21 ` Igor Mammedov
2012-04-05 9:04 ` Michael S. Tsirkin
2012-04-05 9:12 ` Gleb Natapov
2012-04-05 9:37 ` Michael S. Tsirkin
2012-04-05 9:40 ` Gleb Natapov
2012-04-05 9:53 ` Michael S. Tsirkin
2012-04-05 10:08 ` Gleb Natapov
2012-04-05 10:20 ` Michael S. Tsirkin
2012-04-05 10:48 ` Gleb Natapov
2012-04-05 15:12 ` Alex Williamson
2012-04-05 15:38 ` Michael S. Tsirkin
2012-04-05 14:28 ` Alex Williamson
2012-04-05 5:51 ` [Qemu-devel] [PATCH 3/5] acpi_piix4: Use pci_get/set_byte Alex Williamson
2012-04-05 5:51 ` [Qemu-devel] [PATCH 4/5] acpi_piix4: Remove PCI_RMV_BASE write code Alex Williamson
2012-04-05 5:51 ` [Qemu-devel] [PATCH 5/5] acpi_piix4: Fix PCI hotplug race Alex Williamson
2012-04-05 10:03 ` [Qemu-devel] [PATCH 0/5] PCI hotplug fixes/cleanup Michael S. Tsirkin
2012-04-05 11:32 ` Gleb Natapov [this message]
2012-04-05 12:31 ` Michael S. Tsirkin
2012-04-05 15:14 ` Alex Williamson
2012-04-05 15:39 ` Michael S. Tsirkin
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=20120405113229.GH11204@redhat.com \
--to=gleb@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=aurelien@aurel32.net \
--cc=imammedo@redhat.com \
--cc=jbaron@redhat.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yamahata@valinux.co.jp \
/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).