]> git.kernelconcepts.de Git - karo-tx-linux.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)
committerWill Deacon <will.deacon@arm.com>
Mon, 23 Jan 2017 11:48:16 +0000 (11:48 +0000)
commitfdbe574eb69312a7fbe09674d69c01b80e4ed9dc
tree6c4cc7dd1fe4eb0188343281fb83572383ddb8dd
parenta121103c922847ba5010819a3f250f1f7fc84ab8
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>
drivers/iommu/dma-iommu.c
include/linux/dma-iommu.h