Re: [PATCH v5 06/10] vfio-iommufd: Add helper to retrieve iommufd_ctx and devid for vfio_device

Jason Gunthorpe
2023-05-17T18:22:48Z

On Wed, May 17, 2023 at 12:15:17PM -0600, Alex Williamson wrote:

> > +int vfio_iommufd_physical_devid(struct vfio_device *vdev)
> > +{
> > + if (vdev->iommufd_device)
> > + return iommufd_device_to_id(vdev->iommufd_device);
> > + if (vdev->noiommu_access)
> > + return iommufd_access_to_id(vdev->noiommu_access);
> > + return -EINVAL;
> > +}
> > +EXPORT_SYMBOL_GPL(vfio_iommufd_physical_devid);
>
> I think these exemplify that it would be better if both emulated and
> noiommu use the same iommufd_access pointer. Thanks,

Oh, I mis understood your other remark.. Yeah good question I have to
study this also

Jason