vfio: Generalize region support
commitdb0da029a1853d46c90a6c0790ce6ca77fd46ea3
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 10 Mar 2016 16:39:07 +0000 (10 09:39 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 11 Mar 2016 03:03:16 +0000 (10 20:03 -0700)
tree45813d99418cc44c2e7ba46bc3aa4fd0874a3501
parent469002263a295ec471c1498c3b456ccd9f85a841
vfio: Generalize region support

Both platform and PCI vfio drivers create a "slow", I/O memory region
with one or more mmap memory regions overlayed when supported by the
device. Generalize this to a set of common helpers in the core that
pulls the region info from vfio, fills the region data, configures
slow mapping, and adds helpers for comleting the mmap, enable/disable,
and teardown.  This can be immediately used by the PCI MSI-X code,
which needs to mmap around the MSI-X vector table.

This also changes VFIORegion.mem to be dynamically allocated because
otherwise we don't know how the caller has allocated VFIORegion and
therefore don't know whether to unreference it to destroy the
MemoryRegion or not.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/arm/sysbus-fdt.c
hw/vfio/common.c
hw/vfio/pci-quirks.c
hw/vfio/pci.c
hw/vfio/platform.c
include/hw/vfio/vfio-common.h
trace-events