Commit aa4cc17b authored by John Garry's avatar John Garry Committed by Greg Kroah-Hartman
Browse files

dma-iommu: add iommu_dma_opt_mapping_size()



[ Upstream commit 6d9870b7 ]

Add the IOMMU callback for DMA mapping API dma_opt_mapping_size(), which
allows the drivers to know the optimal mapping limit and thus limit the
requested IOVA lengths.

This value is based on the IOVA rcache range limit, as IOVAs allocated
above this limit must always be newly allocated, which may be quite slow.

Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: default avatarRobin Murphy <robin.murphy@arm.com>
Acked-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Stable-dep-of: afc5aa46 ("iommu/dma: Force swiotlb_max_mapping_size on an untrusted device")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f3e7d947
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment