Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

Jacob Pan
2021-05-04T15:39:02Z

Hi Kevin,

On Wed, 28 Apr 2021 06:34:11 +0000, "Tian, Kevin" <kevin.tian@intel.com>
wrote:

> >
> > (also looking at ioasid.c, why do we need such a thin and odd wrapper
> > around xarray?)
> >
>
> I'll leave it to Jean and Jacob.
I am not sure whether you are referring to the current ioasid.c or the
changes proposed in this patchset. I added a per VM/ioasid_set
(also per /dev/ioasid fd) xarray to store guest-host PASID mapping.

The current code has a xarray for the allocators.

struct ioasid_allocator_data {
struct ioasid_allocator_ops *ops;
struct list_head list;
struct list_head slist;
#define IOASID_ALLOCATOR_CUSTOM BIT(0) /* Needs framework to track results */
unsigned long flags;
struct xarray xa;
struct rcu_head rcu;
};

Could you elaborate?

Thanks,

Jacob