Hi Chuck,

thanks for your optimizations!

On Wed, Jan 27, 2021 at 03:00:32PM -0500, Chuck Lever wrote:
> From: Yong Wu <[email protected]>
> 
> iotlb_sync_map allow IOMMU drivers tlb sync after completing the whole
> mapping. This patch adds iova and size as the parameters in it. then the
> IOMMU driver could flush tlb with the whole range once after iova mapping
> to improve performance.
> 
> Signed-off-by: Yong Wu <[email protected]>
> Reviewed-by: Robin Murphy <[email protected]>
> Signed-off-by: Chuck Lever <[email protected]>
> ---
>  drivers/iommu/iommu.c      |    4 ++--
>  drivers/iommu/tegra-gart.c |    7 +++++--
>  include/linux/iommu.h      |    3 ++-
>  3 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index c304a6a30d42..3d099a31ddca 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -2443,7 +2443,7 @@ static int _iommu_map(struct iommu_domain *domain, 
> unsigned long iova,
>  
>       ret = __iommu_map(domain, iova, paddr, size, prot, GFP_KERNEL);
>       if (ret == 0 && ops->iotlb_sync_map)
> -             ops->iotlb_sync_map(domain);
> +             ops->iotlb_sync_map(domain, iova, size);

How about using 'struct iommu_iotlb_gather' instead of directly passing
the iova/size parameters here? The iotlb_sync() call-back uses it
already.

Regards,

        Joerg
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to