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

From: Jason Gunthorpe
Date: Mon Feb 13 2023 - 11:25:25 EST


On Mon, Feb 13, 2023 at 04:20:29PM +0000, Jean-Philippe Brucker wrote:
> On Fri, Feb 10, 2023 at 03:02:06PM -0800, Jacob Pan wrote:
> > Custom allocator feature was introduced to support VT-d's virtual
> > command, an enlightened interface designed for VMs to allocate PASIDs
> > from the host.
> >
> > As we remove/withdraw the VT-d virtual command feature, the sole user
> > of custom allocator, we can safely remove the custom allocator as well.
> > Effectively, this will return IOASID core to the original simple global
> > namespace allocator.
> >
> > Signed-off-by: Jacob Pan <jacob.jun.pan@xxxxxxxxxxxxxxx>
>
> You can also drop the spinlock.h include. With that:
>
> Reviewed-by: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
>
> On a related note, it looks like 100b8a14a370 ("iommu/vt-d: Add pasid
> private data helpers") removed the last user of ioasid_set_data(). I guess
> that could be dropped too, unless you plan to still use it?
>
> 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

This is bascially a shared xarray for a global pasid space.

Jason