From ff146e0175fa9b27a6838c64c76f1e3d4b4cc6a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Aug 2024 15:16:07 +0200 Subject: Adding upstream version 6.9.11. Signed-off-by: Daniel Baumann --- drivers/vfio/group.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/vfio/group.c') diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index 610a429c61..ded364588d 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); + /* + * 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; + 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)); -- cgit v1.2.3