On Wed, May 29, 2024 at 10:52:30PM -0600, Alex Williamson wrote: ... > diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c > index 610a429c6191..ded364588d29 100644 > --- a/drivers/vfio/group.c > +++ b/drivers/vfio/group.c > @@ -286,6 +286,13 @@ static struct file *vfio_device_open_file(struct vfio_device *device) > */ > filep->f_mode |= (FMODE_PREAD | FMODE_PWRITE); > Instead of using anon_inode_getfile(), is it possible to get the filep like filep = alloc_file_pseudo_noaccount(device->inode, get_vfs_mount(),"[vfio-device]", O_RDWR, &vfio_device_fops); > + /* > + * Use the pseudo fs inode on the device to link all mmaps > + * to the same address space, allowing us to unmap all vmas > + * associated to this device using unmap_mapping_range(). > + */ > + filep->f_mapping = device->inode->i_mapping; Then this is not necessary here. Thanks Yan > if (device->group->type == VFIO_NO_IOMMU) > dev_warn(device->dev, "vfio-noiommu device opened by user " > "(%s:%d)\n", current->comm, task_pid_nr(current));