qemu/hw/vfio
Alexey Kardashevskiy 318f67ce13 vfio: spapr: Add DMA memory preregistering (SPAPR IOMMU v2)
This makes use of the new "memory registering" feature. The idea is
to provide the userspace ability to notify the host kernel about pages
which are going to be used for DMA. Having this information, the host
kernel can pin them all once per user process, do locked pages
accounting (once) and not spent time on doing that in real time with
possible failures which cannot be handled nicely in some cases.

This adds a prereg memory listener which listens on address_space_memory
and notifies a VFIO container about memory which needs to be
pinned/unpinned. VFIO MMIO regions (i.e. "skip dump" regions) are skipped.

The feature is only enabled for SPAPR IOMMU v2. The host kernel changes
are required. Since v2 does not need/support VFIO_IOMMU_ENABLE, this does
not call it when v2 is detected and enabled.

This enforces guest RAM blocks to be host page size aligned; however
this is not new as KVM already requires memory slots to be host page
size aligned.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[dwg: Fix compile error on 32-bit host]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-07-05 14:30:54 +10:00
..
amd-xgbe.c all: Clean up includes 2016-02-23 12:43:05 +00:00
calxeda-xgmac.c hw/vfio: Clean up includes 2016-01-29 15:07:24 +00:00
common.c vfio: spapr: Add DMA memory preregistering (SPAPR IOMMU v2) 2016-07-05 14:30:54 +10:00
Makefile.objs vfio: spapr: Add DMA memory preregistering (SPAPR IOMMU v2) 2016-07-05 14:30:54 +10:00
pci-quirks.c vfio/pci: Fix VGA quirks 2016-06-30 13:00:22 -06:00
pci.c vfio/pci: Hide SR-IOV capability 2016-06-30 13:00:23 -06:00
pci.h vfio/pci: Fix VGA quirks 2016-06-30 13:00:22 -06:00
platform.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
spapr.c vfio: spapr: Add DMA memory preregistering (SPAPR IOMMU v2) 2016-07-05 14:30:54 +10:00
trace-events vfio: spapr: Add DMA memory preregistering (SPAPR IOMMU v2) 2016-07-05 14:30:54 +10:00