]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
vfio/spapr: Add a helper to create default DMA window
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 30 Nov 2016 06:52:02 +0000 (17:52 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2016 03:38:31 +0000 (14:38 +1100)
commit6f01cc692a16405235d5c34056455b182682123c
tree2cb4cf08e86e275f223d85c9e43a3e7c7dc3da83
parent39701e56f5f16ea0cf8fc9e8472e645f8de91d23
vfio/spapr: Add a helper to create default DMA window

There is already a helper to create a DMA window which does allocate
a table and programs it to the IOMMU group. However
tce_iommu_take_ownership_ddw() did not use it and did these 2 calls
itself to simplify error path.

Since we are going to delay the default window creation till
the default window is accessed/removed or new window is added,
we need a helper to create a default window from all these cases.

This adds tce_iommu_create_default_window(). Since it relies on
a VFIO container to have at least one IOMMU group (for future use),
this changes tce_iommu_attach_group() to add a group to the container
first and then call the new helper.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/vfio/vfio_iommu_spapr_tce.c