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

Will Deacon
2024-11-18T14:46:38Z

On Sun, Nov 10, 2024 at 03:46:50PM +0200, Leon Romanovsky wrote:
> From: Christoph Hellwig <hch@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@lst.de>
> Signed-off-by: Leon Romanovsky <leonro@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@kernel.org>

Will