qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize
Date: Wed, 05 Jun 2013 10:36:27 -0500	[thread overview]
Message-ID: <8738swr2mc.fsf@codemonkey.ws> (raw)
In-Reply-To: <1370371954-8479-1-git-send-email-pbonzini@redhat.com>

Paolo Bonzini <pbonzini@redhat.com> writes:

> QOM splits the destruction of a device in two phases:
>
> - unrealize, also known as "exit" from qdev times, should isolate
>   the device from the guest.  After unrealize returns, the guest
>   should not be able to issue new requests.
>
> - instance_finalize will reclaim the memory.  This is only called
>   after all requests terminate and drop the references on the
>   device.

Does it make sense to QOM-ify the memory regions?  If they were QOM
objects, they could be added as children and then the reaping would be
handled automatically.

Could be a follow up.

Regards,

Anthony Liguori

>
> This is important even now, but overlooked.  It will become much
> more important for devices that will be able to access memory
> out of the big QEMU lock.
>
> This series changes all PCI devices (the sole to support hotplug
> _and_ use MemoryRegions) to do memory_region_del_subregion at
> unrealize time, and memory_region_destroy at instance_finalize
> time.
>
> This is mostly a PCI patch, and independent from the others,
> so I believe it should go through mst's tree.
>
> Paolo
>
>
> Paolo Bonzini (39):
>   scsi: keep device alive while it has requests
>   dma: keep a device alive while it has SGLists
>   pci: split exit and finalize
>   ac97: use instance_finalize instead of exit
>   es1370: use instance_finalize instead of exit
>   hda: use instance_finalize instead of exit
>   serial: use instance_finalize instead of exit
>   tpci200: use instance_finalize instead of exit
>   pci-assign: use instance_finalize instead of exit
>   ahci: use instance_finalize instead of exit
>   msix: split msix_free from msix_uninit
>   cmd646: use instance_finalize instead of exit
>   ide/piix: use instance_finalize instead of exit
>   ide/via: use instance_finalize instead of exit
>   ivshmem: use instance_finalize instead of exit
>   pci-testdev: use instance_finalize instead of exit
>   vfio: use instance_finalize instead of exit
>   e1000: use instance_finalize instead of exit
>   eepro100: use instance_finalize instead of exit
>   ne2000: use instance_finalize instead of exit
>   pcnet: use instance_finalize instead of exit
>   rtl8139: use instance_finalize instead of exit
>   vmxnet3: use instance_finalize instead of exit
>   shpc: use instance_finalize instead of exit
>   pci_bridge: split pci_bridge_exitfn from pci_bridge_free
>   pcie_aer: pcie_aer_exit really frees stuff
>   pci_bridge: use instance_finalize instead of exit
>   ioh4320: use instance_finalize instead of exit
>   xio3130-downstream: use instance_finalize instead of exit
>   xio3130-upstream: use instance_finalize instead of exit
>   pcie: do not recreate mmcfg I/O region, use an alias instead
>   esp: use instance_finalize instead of exit
>   lsi: use instance_finalize instead of exit
>   pvscsi: use instance_finalize instead of exit
>   usb-uhci: use instance_finalize instead of exit
>   virtio-pci: use instance_finalize instead of exit
>   wdt_i6300esb: use instance_finalize instead of exit
>   xen_pt: use instance_finalize instead of exit
>   tpm: move add/del_subregion to realize/unrealize
>
>  dma-helpers.c                      |  6 ++++-
>  hw/audio/ac97.c                    |  5 ++--
>  hw/audio/es1370.c                  |  5 ++--
>  hw/audio/intel-hda.c               |  8 ++++++
>  hw/char/serial-pci.c               | 24 ++++++++++++++++++
>  hw/char/tpci200.c                  |  5 ++--
>  hw/i386/kvm/pci-assign.c           |  8 ++++++
>  hw/ide/ahci.c                      |  5 ++--
>  hw/ide/ahci.h                      |  2 +-
>  hw/ide/cmd646.c                    |  5 ++--
>  hw/ide/ich.c                       | 13 +++++++---
>  hw/ide/macio.c                     |  4 +--
>  hw/ide/piix.c                      |  8 +++---
>  hw/ide/via.c                       |  5 ++--
>  hw/misc/ivshmem.c                  | 10 +++++++-
>  hw/misc/pci-testdev.c              |  5 ++--
>  hw/misc/vfio.c                     | 52 +++++++++++++++++++++++++++++++++++---
>  hw/net/e1000.c                     |  5 ++--
>  hw/net/eepro100.c                  |  5 ++--
>  hw/net/ne2000.c                    |  5 ++--
>  hw/net/pcnet-pci.c                 |  5 ++--
>  hw/net/rtl8139.c                   |  5 ++--
>  hw/net/vmxnet3.c                   | 14 ++++++++--
>  hw/pci-bridge/i82801b11.c          |  1 +
>  hw/pci-bridge/ioh3420.c            | 11 +++++++-
>  hw/pci-bridge/pci_bridge_dev.c     | 14 +++++++++-
>  hw/pci-bridge/xio3130_downstream.c | 11 +++++++-
>  hw/pci-bridge/xio3130_upstream.c   | 11 +++++++-
>  hw/pci/msix.c                      | 26 ++++++++++++++-----
>  hw/pci/pci.c                       | 15 ++++++++---
>  hw/pci/pci_bridge.c                |  5 ++++
>  hw/pci/pcie_aer.c                  |  3 ++-
>  hw/pci/pcie_host.c                 | 22 ++++++++++++----
>  hw/pci/shpc.c                      |  8 +++++-
>  hw/scsi/esp-pci.c                  |  5 ++--
>  hw/scsi/lsi53c895a.c               |  5 ++--
>  hw/scsi/megasas.c                  |  4 +--
>  hw/scsi/scsi-bus.c                 |  4 +++
>  hw/scsi/virtio-scsi.c              | 10 +++++---
>  hw/scsi/vmw_pvscsi.c               | 12 ++++++++-
>  hw/tpm/tpm_tis.c                   | 14 +++++++---
>  hw/usb/hcd-ehci.c                  |  4 +--
>  hw/usb/hcd-uhci.c                  |  5 ++--
>  hw/virtio/virtio-pci.c             | 10 +++++++-
>  hw/watchdog/wdt_i6300esb.c         |  5 ++--
>  hw/xen/xen_pt.c                    | 10 ++++++++
>  hw/xen/xen_pt_config_init.c        |  3 ---
>  hw/xen/xen_pt_msi.c                |  8 +++++-
>  include/hw/pci/msix.h              |  1 +
>  include/hw/pci/pci.h               |  2 +-
>  include/hw/pci/pci_bridge.h        |  1 +
>  include/hw/pci/pcie_aer.h          |  2 +-
>  include/hw/pci/pcie_host.h         |  1 +
>  include/hw/pci/shpc.h              |  1 +
>  include/sysemu/dma.h               |  4 ++-
>  55 files changed, 355 insertions(+), 92 deletions(-)
>
> -- 
> 1.8.1.4

      parent reply	other threads:[~2013-06-05 15:36 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 18:51 [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize Paolo Bonzini
2013-06-04 18:51 ` [Qemu-devel] [PATCH 01/39] scsi: keep device alive while it has requests Paolo Bonzini
2013-06-07  7:48   ` Andreas Färber
2013-06-07 14:01     ` Anthony Liguori
2013-06-04 18:51 ` [Qemu-devel] [PATCH 02/39] dma: keep a device alive while it has SGLists Paolo Bonzini
2013-06-07  7:50   ` Andreas Färber
2013-06-07 14:04     ` Anthony Liguori
2013-06-04 18:51 ` [Qemu-devel] [PATCH 03/39] pci: split exit and finalize Paolo Bonzini
2013-06-07 14:05   ` Anthony Liguori
2013-06-04 18:51 ` [Qemu-devel] [PATCH 04/39] ac97: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 05/39] es1370: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 06/39] hda: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 07/39] serial: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 08/39] tpci200: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 09/39] pci-assign: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 10/39] ahci: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 11/39] msix: split msix_free from msix_uninit Paolo Bonzini
2013-06-04 22:03   ` Michael S. Tsirkin
2013-06-04 22:40     ` Paolo Bonzini
2013-06-05  4:53       ` Michael S. Tsirkin
2013-06-05  7:48         ` Paolo Bonzini
2013-06-05 10:32           ` Michael S. Tsirkin
2013-06-07  1:01             ` Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 12/39] cmd646: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 13/39] ide/piix: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 14/39] ide/via: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 15/39] ivshmem: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 16/39] pci-testdev: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 17/39] vfio: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 18/39] e1000: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 19/39] eepro100: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 20/39] ne2000: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 21/39] pcnet: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 22/39] rtl8139: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 23/39] vmxnet3: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 24/39] shpc: split shpc_free out of shpc_cleanup Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 25/39] pci_bridge: split pci_bridge_free from pci_bridge_exitfn Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 26/39] pcie_aer: pcie_aer_exit really frees stuff Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 27/39] pci_bridge: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 28/39] ioh4320: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 29/39] xio3130-downstream: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 30/39] xio3130-upstream: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 31/39] pcie: do not recreate mmcfg I/O region, use an alias instead Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 32/39] esp: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 33/39] lsi: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 34/39] pvscsi: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 35/39] usb-uhci: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 36/39] virtio-pci: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 37/39] wdt_i6300esb: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 38/39] xen_pt: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 39/39] tpm: move add/del_subregion to realize/unrealize Paolo Bonzini
2013-06-07  8:02   ` Andreas Färber
2013-06-05  9:50 ` [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize Andreas Färber
2013-06-05 11:10   ` Michael S. Tsirkin
2013-06-05 11:32     ` Andreas Färber
2013-06-05 12:06       ` Michael S. Tsirkin
2013-06-05 12:23         ` Andreas Färber
2013-06-05 12:36           ` Michael S. Tsirkin
2013-06-05 12:47             ` Andreas Färber
2013-06-05 11:38     ` Peter Maydell
2013-06-05 12:02       ` Michael S. Tsirkin
2013-06-05 12:15       ` Michael S. Tsirkin
2013-06-05 12:53     ` Anthony Liguori
2013-06-05 14:27       ` Michael S. Tsirkin
2013-06-05 15:33         ` Anthony Liguori
2013-06-05 15:44           ` Michael S. Tsirkin
2013-06-05 15:48             ` Peter Maydell
2013-06-07  1:03   ` Paolo Bonzini
2013-06-07  7:45     ` Andreas Färber
2013-06-07 12:13       ` Paolo Bonzini
2013-06-07  8:41     ` Peter Crosthwaite
2013-06-07 13:25       ` Andreas Färber
2013-06-05 15:36 ` Anthony Liguori [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=8738swr2mc.fsf@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=mst@redhat.com \
    --cc=pbonzini@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).