> From: Liu, Yi L <[email protected]>
> Sent: Wednesday, June 14, 2023 2:14 PM
> 
> 
> > With that I think Jason's suggestion is to lift that test into main.c:
> >
> > int vfio_register_group_dev(struct vfio_device *device)
> > {
> >     /*
> >      * VFIO always sets IOMMU_CACHE because we offer no way for
> userspace to
> >      * restore cache coherency. It has to be checked here because it is
> only
> >      * valid for cases where we are using iommu groups.
> >      */
> >     if (type == VFIO_IOMMU && !vfio_device_is_noiommu(device) &&
> >         !device_iommu_capable(dev, IOMMU_CAP_CACHE_COHERENCY))
> >             return ERR_PTR(-EINVAL);
> 
> vfio_device_is_noiommu() needs to be called after vfio_device_set_group().
> Otherwise, it's always false. So still needs to call it in the
> __vfio_register_dev().

yes

Reply via email to