> From: Jason Gunthorpe <jgg@xxxxxxxxxx> > Sent: Saturday, February 4, 2023 1:41 AM > > On Thu, Feb 02, 2023 at 05:34:15AM +0000, Liu, Yi L wrote: > > > This seems to be ok. The group path will attach the group to an auto- > allocated > > iommu_domain, while the cdev path actually waits for userspace to > > attach it to an IOAS. Userspace should take care of it. It should ensure > > the devices in the same group should be attached to the same domain. > > Aren't there problems when someone closes the group or device FD while > the other one is still open though? Guess no. userspace can only open devices from the same group by both group path and cdev path when the group path is iommufd compat mode and uses the same iommufd as cdev path. This means the attach API are the same in the two paths. I think iommufd attach API is able to manage one device is closed while other devices are still attached. Regards, Yi Liu