Re: [RFC v2] /dev/iommu uAPI proposal

From: Jason Gunthorpe
Date: Fri Jul 16 2021 - 14:30:21 EST


On Fri, Jul 16, 2021 at 01:20:15AM +0000, Tian, Kevin wrote:

> One thought is to have vfio device driver deal with it. In this proposal
> it is the vfio device driver to define the PASID virtualization policy and
> report it to userspace via VFIO_DEVICE_GET_INFO. The driver understands
> the restriction thus could just hide the vPASID capability when the user
> calls GET_INFO on the 2nd mdev in above scenario. In this way the
> user even doesn't need to know such restriction at all and both mdevs
> can be assigned to a single VM w/o any problem.

I think it makes more sense to expose some kind of "pasid group" to
qemu that identifies that each PASID must be unique across the
group. For vIOMMUs that are doing funky things with the RID This means
a single PASID group must not be exposed as two RIDs to the guest.

If the kernel blocks it then it can never be fixed by updating the
vIOMMU design.

Jason