> From: Jason Gunthorpe <jgg@xxxxxxxxxx> > Sent: Friday, May 6, 2022 8:25 AM > > The split follows the pairing with the destroy functions: > > - vfio_group_get_device_fd() destroyed by close() > > - vfio_device_open() destroyed by vfio_device_fops_release() > > - vfio_device_assign_container() destroyed by > vfio_group_try_dissolve_container() > > The next patch will put a lock around vfio_device_assign_container(). > > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx> > - if (group->type == VFIO_NO_IOMMU && !capable(CAP_SYS_RAWIO)) > - return -EPERM; > + if (group->type == VFIO_NO_IOMMU) { > + if (!capable(CAP_SYS_RAWIO)) > + return -EPERM; > + dev_warn(device->dev, > + "vfio-noiommu device opened by user (%s:%d)\n", > + current->comm, task_pid_nr(current)); > + } after this move is 'opened' the right status? Probably clearer to say that the user is attempting to open a vfio-noiommu device at this point...