Re: [PATCH 2/2] iommu/ioasid: Remove custom IOASID allocator

From: Jason Gunthorpe
Date: Mon Feb 13 2023 - 18:19:08 EST


On Mon, Feb 13, 2023 at 01:44:02PM -0800, Jacob Pan wrote:
> > Your DMA API PASID thing will simply need one new API to alloc/free a
> > PASID from the iommu_global_pasid_ida
> It should satisfy what we need right now.
> Just wondering if we were to do resource management of global PASIDs, say
> with the new misc cgroup controller, do we plan to expand in iommu sva code?
> If yes, do we keep DMA API PASID in a separate range/set?

I would say all shared PASIDs held by userspace should be captured by
by a resource limit, it doesn't matter if they are global PASIDs or
device local shared PASIDs.

So if a cgroup comes it is just a matter of putting charges in the
right place which is auditable by looking at calls to attach pasid
functions.

Jason