vfio: Enable for SPAPR
commit591812634c84471fc68feb259ebebb82d0d5513a
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 10 Jun 2014 05:39:24 +0000 (10 15:39 +1000)
committerAlexander Graf <agraf@suse.de>
Fri, 27 Jun 2014 11:48:23 +0000 (27 13:48 +0200)
tree10d380b2c2ef9dcdb4fe03f60d3aaf486d4c2a47
parent9fc34ada7e80a7c561f64eb124b2b814a8feca68
vfio: Enable for SPAPR

This turns the sPAPR support on and enables VFIO container use
in the kernel.

This extends vfio_connect_container to support VFIO_SPAPR_TCE_IOMMU type
in the host kernel.

This registers a memory listener which sPAPR IOMMU will notify when
executing H_PUT_TCE/etc DMA calls. The listener then will notify the host
kernel about DMA map/unmap operation via VFIO_IOMMU_MAP_DMA/
VFIO_IOMMU_UNMAP_DMA ioctls.

This executes VFIO_IOMMU_ENABLE ioctl to make sure that the IOMMU is free
of mappings and can be exclusively given to the user. At the moment SPAPR
is the only platform requiring this call to be implemented.

Note that the host kernel function implementing VFIO_IOMMU_DISABLE
is called automatically when container's fd is closed so there is
no need to call it explicitly from QEMU. We may need to call
VFIO_IOMMU_DISABLE explicitly in the future for some sort of dynamic
reconfiguration (PCI hotplug or dynamic IOMMU group management).

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/misc/vfio.c