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

Jason Gunthorpe
2023-02-13T19:43:46Z

On Mon, Feb 13, 2023 at 11:11:52AM -0800, Jacob Pan wrote:
> Hi Jason,
>
> On Mon, 13 Feb 2023 12:24:15 -0400, Jason Gunthorpe <jgg@nvidia.com> wrote:
>
> > > We could also merge ioasid.c into iommu-sva.c at this point, since I
> > > haven't seen any interest for having multiple IOASID sets on Arm, but
> > > I'm not sure what the current plan is for vSVA on x86.
> >
> > Once the customer allocator is removed this is bascially a thin
> > wrapper around xarray
> >
> > So anything that needs multiple pasid spaces should just create it on
> > its own directly with xarray
> >
> Just wanted to double check that for devices on VT-d platforms that support
> both SVA and DMA API with PASID, we will still need a single global pasid
> space (due to IOTLB tagging).

Each driver chooses the PASID allocator it wants to use.

If the driver uses SVA then the driver must select the global SVA
allocator. If the driver needs PASID's for other purposes then it must
get them from the SVA allocator too.

> As I replied to Jean as well, we could use the ioasid_set to separate SVA
> and DMA API PASIDs.

That doesn't make sense to me..

Jason