]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
iommu/dma: Allow MSI-only cookies
authorRobin Murphy <robin.murphy@arm.com>
Thu, 19 Jan 2017 20:57:46 +0000 (20:57 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 21 Feb 2017 17:00:23 +0000 (10:00 -0700)
commitc2785df7b6963c8e3075344cc2edb4eae38e86a0
treec0ff3c8daa39cb6cf5fc499772d81612aabb2efa
parent6a71baea6c7492e6f87516e3ad82ea13fc26808d
iommu/dma: Allow MSI-only cookies

IOMMU domain users such as VFIO face a similar problem to DMA API ops
with regard to mapping MSI messages in systems where the MSI write is
subject to IOMMU translation. With the relevant infrastructure now in
place for managed DMA domains, it's actually really simple for other
users to piggyback off that and reap the benefits without giving up
their own IOVA management, and without having to reinvent their own
wheel in the MSI layer.

Allow such users to opt into automatic MSI remapping by dedicating a
region of their IOVA space to a managed cookie, and extend the mapping
routine to implement a trivial linear allocator in such cases, to avoid
the needless overhead of a full-blown IOVA domain.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com>
Tested-by: Bharat Bhushan <bharat.bhushan@nxp.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit fdbe574eb69312a7fbe09674d69c01b80e4ed9dc)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/iommu/dma-iommu.c
include/linux/dma-iommu.h