]> git.proxmox.com Git - mirror_qemu.git/commit - hw/vfio/common.c
vfio/spapr: Create DMA window dynamically (SPAPR IOMMU v2)
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Mon, 4 Jul 2016 03:33:06 +0000 (13:33 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 5 Jul 2016 04:31:08 +0000 (14:31 +1000)
commit2e4109de8e589beecd69996ee14f24021b991c0d
tree6ae3ddcd94419eada161c30501ec0df834790486
parentf4ec5e26edbd4c7509623ec882c344dc334bc1b2
vfio/spapr: Create DMA window dynamically (SPAPR IOMMU v2)

New VFIO_SPAPR_TCE_v2_IOMMU type supports dynamic DMA window management.
This adds ability to VFIO common code to dynamically allocate/remove
DMA windows in the host kernel when new VFIO container is added/removed.

This adds a helper to vfio_listener_region_add which makes
VFIO_IOMMU_SPAPR_TCE_CREATE ioctl and adds just created IOMMU into
the host IOMMU list; the opposite action is taken in
vfio_listener_region_del.

When creating a new window, this uses heuristic to decide on the TCE table
levels number.

This should cause no guest visible change in behavior.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
[dwg: Added some casts to prevent printf() warnings on certain targets
 where the kernel headers' __u64 doesn't match uint64_t or PRIx64]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/vfio/common.c
hw/vfio/spapr.c
hw/vfio/trace-events
include/hw/vfio/vfio-common.h