[PATCH 0/2] iommu: Remove iommu_sva_ops::mm_exit()

Jacob Pan jacob.jun.pan at linux.intel.com
Thu Apr 9 04:35:52 AEST 2020


Hi Jean,

On Wed,  8 Apr 2020 16:04:25 +0200
Jean-Philippe Brucker <jean-philippe at linaro.org> wrote:

> The IOMMU SVA API currently requires device drivers to implement an
> mm_exit() callback, which stops device jobs that do DMA. This function
> is called in the release() MMU notifier, when an address space that is
> shared with a device exits.
> 
> It has been noted several time during discussions about SVA that
> cancelling DMA jobs can be slow and complex, and doing it in the
> release() notifier might cause synchronization issues (patch 2 has
> more background). Device drivers must in any case call unbind() to
> remove their bond, after stopping DMA from a more favorable context
> (release of a file descriptor).
> 
> So after mm exits, rather than notifying device drivers, we can hold
> on to the PASID until unbind(), ask IOMMU drivers to silently abort
> DMA and Page Requests in the meantime. This change should relieve the
> mmput() path.
> 
I assume mm is destroyed after all the FDs are closed, so if uacce
tied unbind to FD release then unbind already happened before mm is
destroyed. What is there to worry about?

In VT-d, because of enqcmd and lazy PASID free we plan to hold on to the
PASID until mmdrop.
https://lore.kernel.org/patchwork/patch/1217762/

> Patch 1 removes the mm_exit() callback from the uacce module, and
> patch 2 removes it from the IOMMU API.
> 
> Jean-Philippe Brucker (2):
>   uacce: Remove mm_exit() op
>   iommu: Remove iommu_sva_ops::mm_exit()
> 
>  include/linux/iommu.h      |  30 -------
>  include/linux/uacce.h      |  34 ++------
>  drivers/iommu/iommu.c      |  11 ---
>  drivers/misc/uacce/uacce.c | 171
> +++++++++---------------------------- 4 files changed, 50
> insertions(+), 196 deletions(-)
> 

[Jacob Pan]


More information about the Linux-accelerators mailing list