Zhen Lei 2da274cdf9 iommu/dma: Add support for non-strict mode
With the flush queue infrastructure already abstracted into IOVA
domains, hooking it up in iommu-dma is pretty simple. Since there is a
degree of dependency on the IOMMU driver knowing what to do to play
along, we key the whole thing off a domain attribute which will be set
on default DMA ops domains to request non-strict invalidation. That way,
drivers can indicate the appropriate support by acknowledging the
attribute, and we can easily fall back to strict invalidation otherwise.

The flush queue callback needs a handle on the iommu_domain which owns
our cookie, so we have to add a pointer back to that, but neatly, that's
also sufficient to indicate whether we're using a flush queue or not,
and thus which way to release IOVAs. The only slight subtlety is
switching __iommu_dma_unmap() from calling iommu_unmap() to explicit
iommu_unmap_fast()/iommu_tlb_sync() so that we can elide the sync
entirely in non-strict mode.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
[rm: convert to domain attribute, tweak comments and commit message]
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2018-10-01 13:01:32 +01:00
..
2018-08-24 13:10:38 -07:00
2018-07-06 13:26:10 +02:00
2018-08-24 13:10:38 -07:00
2017-08-23 16:28:09 +02:00
2018-08-24 13:10:38 -07:00
2018-08-24 13:10:38 -07:00
2018-08-08 11:06:20 +02:00
2018-08-24 13:10:38 -07:00
2018-08-24 13:10:38 -07:00
2018-07-10 17:22:35 +02:00
2018-08-24 13:10:38 -07:00
2018-08-25 14:12:36 -07:00