Re: [PATCH 04/10] vfio: Use a struct of function pointers instead of a many symbol_get()'s

Jason Gunthorpe
2022-04-19T12:16:42Z

On Mon, Apr 18, 2022 at 03:56:01AM +0000, Tian, Kevin wrote:

> - Each mm is associated with a set of authorized PASIDs (ioasid_set);
> - VFIO driver provides a uAPI for userspace to attach a guest virtual
> PASID (vPASID) to a hw page table in iommufd. In the uAPI:
> - a physical PASID (pPASID) is allocated and added to mm's ioasid_set;
> - the pPASID is used to actually attach to the hw page table;
> - the pPASID is returned to userspace upon successful attach;
> - KVM provides a uAPI for userspace to map/unmap vPASID to pPASID
> in CPU PASID translation structure. User-provided pPASID must be
> found in mm->ioasid_set;

It is more logical to be current->ioasid_set, not mm

But yes, something like this. The mdev api may want to mirror the kvm
api and map/unmap vPASID to pPASID

Jason