Re: [PATCH V3 07/10] vfio: Enable cdev noiommu mode under iommufd
From: Jacob Pan
Date: Mon Apr 13 2026 - 18:43:28 EST
Hi Jason,
On Thu, 9 Apr 2026 15:48:41 -0300
Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:
> On Thu, Apr 02, 2026 at 10:11:43PM -0700, Jacob Pan wrote:
> > @@ -392,6 +398,16 @@ void vfio_unregister_group_dev(struct
> > vfio_device *device) bool interrupted = false;
> > long rc;
> >
> > + /*
> > + * For noiommu devices without a container, thus no dummy
> > group,
> > + * simply delete and unregister to balance refcount.
> > + */
> > + if (device->noiommu && !vfio_device_has_group(device)) {
> > + vfio_device_del(device);
> > + vfio_device_put_registration(device);
> > + return;
> > + }
> > +
>
> Sashiko points out this can't just skip the waiting even for no-iommu
> mode, it isn't linked to groups and containers but the lifecylce of
> the open FD.
>
> Maybe just stick a !group inside vfio_device_group_unregister() is
> sufficient?
Yes, will do.
Thanks,
Jacob