All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 00/17] Memory/IOMMU patches part 4: region ownership
@ 2013-06-04 12:13 Paolo Bonzini
  2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 01/17] memory: add getter/setter for owner Paolo Bonzini
                   ` (16 more replies)
  0 siblings, 17 replies; 36+ messages in thread
From: Paolo Bonzini @ 2013-06-04 12:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

Now that the DMA APIs are unified, we move closer and closer to breaking
memory access from the BQL dependency.  This series adds an API to
reference/unreference memory regions, which is not really needed only
for BQL-less memory access: the big lock can already be dropped between
address_space_map and the corresponding unmap, and the last patch fixes
potential problems in this area if the DMA destination is hot-unplugged.
Lockless memory access only makes things a bit worse.

Reference counting the region piggybacks on reference counting of a QOM
object, the "owner" of the region.  The owner API is designed so that
it will be called as little as possible.  Unowned subregions will get a
region if memory_region_set_owner is called after the subregion is added.
This is in general the common case already; often setting the owner can
be delegated to a bus-specific API that already takes a DeviceState
(for example pci_register_bar or sysbus_init_mmio).

As mentioned earlier, I'm not sending a pull request for the previous
part yet.  Unplugging a PCI bridge found a reference counting bug in
memory_region_set_owner.

To test this I tried hot-unplug for all PCI devices.

Paolo

v1->v2: fixed reference counting bug in memory_region_set_owner
        added sysbus_pass_mmio (patch 6)
        moved qemu_ram_addr_from_host_nofail to cputlb.c (patch 15)

Paolo Bonzini (17):
  memory: add getter/setter for owner
  memory: add ref/unref
  memory: add ref/unref calls
  exec: add a reference to the region returned by
    address_space_translate
  pci: set owner for BARs
  sysbus: add sysbus_pass_mmio
  sysbus: set owner for MMIO regions
  acpi: add memory_region_set_owner calls
  misc: add memory_region_set_owner calls
  isa/portio: allow setting an owner
  vga: add memory_region_set_owner calls
  pci-assign: add memory_region_set_owner calls
  vfio: add memory_region_set_owner calls
  exec: check MRU in qemu_ram_addr_from_host
  exec: move qemu_ram_addr_from_host_nofail to cputlb.c
  memory: return MemoryRegion from qemu_ram_addr_from_host
  memory: ref/unref memory across address_space_map/unmap

 cputlb.c                              | 11 +++++
 exec.c                                | 90 +++++++++++++++++++++++------------
 hw/acpi/ich9.c                        |  1 +
 hw/acpi/piix4.c                       |  5 ++
 hw/char/serial-pci.c                  |  1 +
 hw/core/loader.c                      |  1 +
 hw/core/sysbus.c                      | 14 ++++++
 hw/cpu/arm11mpcore.c                  |  2 +-
 hw/display/cirrus_vga.c               | 19 ++++++--
 hw/display/exynos4210_fimd.c          |  6 +++
 hw/display/framebuffer.c              | 12 +++--
 hw/display/qxl.c                      |  6 ++-
 hw/display/vga-isa-mm.c               |  2 +-
 hw/display/vga-isa.c                  |  4 +-
 hw/display/vga-pci.c                  |  5 +-
 hw/display/vga.c                      | 19 ++++++--
 hw/display/vga_int.h                  |  9 ++--
 hw/display/vmware_vga.c               |  4 +-
 hw/i386/kvm/pci-assign.c              | 11 +++++
 hw/i386/kvmvapic.c                    |  1 +
 hw/isa/apm.c                          |  1 +
 hw/isa/isa-bus.c                      |  2 +
 hw/misc/pc-testdev.c                  |  7 +++
 hw/misc/vfio.c                        | 10 ++++
 hw/pci/pci.c                          |  2 +
 hw/virtio/dataplane/hostmem.c         |  7 +++
 hw/virtio/vhost.c                     |  2 +
 hw/virtio/virtio-balloon.c            |  1 +
 hw/xen/xen_pt.c                       |  4 ++
 include/exec/cpu-common.h             |  3 +-
 include/exec/ioport.h                 |  3 ++
 include/exec/memory.h                 | 69 ++++++++++++++++++++++++++-
 include/hw/sysbus.h                   |  1 +
 include/hw/virtio/dataplane/hostmem.h |  1 +
 ioport.c                              | 10 ++++
 kvm-all.c                             |  2 +
 memory.c                              | 79 ++++++++++++++++++++++++++++++
 target-arm/kvm.c                      |  2 +
 target-i386/kvm.c                     |  4 +-
 target-sparc/mmu_helper.c             |  1 +
 xen-all.c                             |  2 +
 41 files changed, 372 insertions(+), 64 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2013-06-25  8:49 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-04 12:13 [Qemu-devel] [PATCH v2 00/17] Memory/IOMMU patches part 4: region ownership Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 01/17] memory: add getter/setter for owner Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 02/17] memory: add ref/unref Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 03/17] memory: add ref/unref calls Paolo Bonzini
2013-06-13  6:28   ` Alexey Kardashevskiy
2013-06-13  9:02     ` Alexey Kardashevskiy
2013-06-14 10:09       ` Alexey Kardashevskiy
2013-06-14 13:56         ` Paolo Bonzini
2013-06-14 15:04           ` Alexey Kardashevskiy
2013-06-25  8:49         ` Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 04/17] exec: add a reference to the region returned by address_space_translate Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 05/17] pci: set owner for BARs Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 06/17] sysbus: add sysbus_pass_mmio Paolo Bonzini
2013-06-04 12:24   ` Peter Maydell
2013-06-04 12:31     ` Paolo Bonzini
2013-06-04 12:36       ` Peter Maydell
2013-06-04 13:24         ` Paolo Bonzini
2013-06-04 14:11           ` Peter Maydell
2013-06-04 14:27             ` Paolo Bonzini
2013-06-04 14:56               ` Peter Maydell
2013-06-04 15:06                 ` Paolo Bonzini
2013-06-04 16:50           ` Paolo Bonzini
2013-06-04 17:47             ` Alex Williamson
2013-06-04 19:11               ` Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 07/17] sysbus: set owner for MMIO regions Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 08/17] acpi: add memory_region_set_owner calls Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 09/17] misc: " Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 10/17] isa/portio: allow setting an owner Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 11/17] vga: add memory_region_set_owner calls Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 12/17] pci-assign: " Paolo Bonzini
2013-06-04 16:42   ` Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 13/17] vfio: " Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 14/17] exec: check MRU in qemu_ram_addr_from_host Paolo Bonzini
2013-06-04 12:13 ` [Qemu-devel] [PATCH v2 15/17] exec: move qemu_ram_addr_from_host_nofail to cputlb.c Paolo Bonzini
2013-06-04 12:14 ` [Qemu-devel] [PATCH v2 16/17] memory: return MemoryRegion from qemu_ram_addr_from_host Paolo Bonzini
2013-06-04 12:14 ` [Qemu-devel] [PATCH v2 17/17] memory: ref/unref memory across address_space_map/unmap Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.