On Wed, Mar 15, 2023 at 06:15:02AM +0000, Liu, Yi L wrote:

> > > +void vfio_iommufd_emulated_detach_ioas(struct vfio_device *vdev)
> > > +{
> > > +       lockdep_assert_held(&vdev->dev_set->lock);
> > > +
> > > +       if (WARN_ON(!vdev->iommufd_access))
> > > +               return;
> > > +
> > [...]
> > > +       iommufd_access_destroy(vdev->iommufd_access);
> > > +       vdev->iommufd_access = NULL;
> >
> > After moving access allocation/destroy to bind/unbind, here it
> > should be:
> >       iommufd_access_set_ioas(vdev->iommufd_access, 0);
> 
> You are right.

Yet...iommufd_access_set_ioas is getting reworked with my patch:
In another thread, Jason suggested to have iommufd_acces_detach
API, and I am trying to finalize it with Jason/Kevin.
https://lore.kernel.org/kvm/bn9pr11mb5276738dc59ac1b4a66ab3c38c...@bn9pr11mb5276.namprd11.prod.outlook.com/

Nic

Reply via email to