Hi Jean,

Slightly off the title. As we are moving to use cgroup to limit PASID
allocations, it would be much simpler if we enforce on the current task.

However, iommu_sva_alloc_pasid() takes an mm_struct pointer as argument
which implies it can be something other the the current task mm. So far all
kernel callers use current task mm. Is there a use case for doing PASID
allocation on behalf of another mm? If not, can we remove the mm argument?

Thanks,

Jacob

>  /**
>   * iommu_sva_alloc_pasid - Allocate a PASID for the mm
> @@ -35,11 +44,11 @@ int iommu_sva_alloc_pasid(struct mm_struct *mm,
> ioasid_t min, ioasid_t max) mutex_lock(&iommu_sva_lock);
>       if (mm->pasid) {
>               if (mm->pasid >= min && mm->pasid <= max)
> -                     ioasid_get(mm->pasid);
> +                     ioasid_get(iommu_sva_pasid, mm->pasid);
>               else
>                       ret = -EOVERFLOW;
>       } else {
> -             pasid = ioasid_alloc(&iommu_sva_pasid, min, max, mm);
> +             pasid = ioasid_alloc(iommu_sva_pasid, min, max, mm);
>               if (pasid == INVALID_IOASID)
>                       ret = -ENOMEM;

Thanks,

Jacob
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to