[PATCH v3 03/17] iommu: generalize the batched sync after map interface

Will Deacon will at kernel.org
Mon Nov 18 06:46:25 PST 2024


On Sun, Nov 10, 2024 at 03:46:50PM +0200, Leon Romanovsky wrote:
> From: Christoph Hellwig <hch at lst.de>
> 
> For the upcoming IOVA-based DMA API we want to use the interface batch the
> sync after mapping multiple entries from dma-iommu without having a
> scatterlist.
> 
> For that move more sanity checks from the callers into __iommu_map and
> make that function available outside of iommu.c as iommu_map_nosync.
> 
> Add a wrapper for the map_sync as iommu_sync_map so that callers don't
> need to poke into the methods directly.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> Signed-off-by: Leon Romanovsky <leonro at nvidia.com>
> ---
>  drivers/iommu/iommu.c | 65 +++++++++++++++++++------------------------
>  include/linux/iommu.h |  4 +++
>  2 files changed, 33 insertions(+), 36 deletions(-)

I was a little worried that exposing iommu_map_nosync() directly could
expose driver bugs where the range being sync'd was assumed to be mapped,
but I couldn't spot anything obvious from a quick check, so:

Acked-by: Will Deacon <will at kernel.org>

Will



More information about the Linux-nvme mailing list