summaryrefslogtreecommitdiff
path: root/drivers/vfio/mdev/vfio_mdev.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-09-24 17:56:57 +0200
committerAlex Williamson <alex.williamson@redhat.com>2021-09-30 12:46:44 -0600
commitc68ea0d00ad82428154aed890ec9f793e460fa1c (patch)
tree663fb526e33c3322c770c9a16097d26351d69534 /drivers/vfio/mdev/vfio_mdev.c
parentc04ac34078a4d7c08e1218b548e0a6b197f01582 (diff)
downloadlinux-c68ea0d00ad82428154aed890ec9f793e460fa1c.tar.gz
linux-c68ea0d00ad82428154aed890ec9f793e460fa1c.tar.bz2
linux-c68ea0d00ad82428154aed890ec9f793e460fa1c.zip
vfio: simplify iommu group allocation for mediated devices
Reuse the logic in vfio_noiommu_group_alloc to allocate a fake single-device iommu group for mediated devices by factoring out a common function, and replacing the noiommu boolean field in struct vfio_group with an enum to distinguish the three different kinds of groups. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/20210924155705.4258-8-hch@lst.de Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/mdev/vfio_mdev.c')
-rw-r--r--drivers/vfio/mdev/vfio_mdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/mdev/vfio_mdev.c b/drivers/vfio/mdev/vfio_mdev.c
index 7a9883048216..a90e24b0c851 100644
--- a/drivers/vfio/mdev/vfio_mdev.c
+++ b/drivers/vfio/mdev/vfio_mdev.c
@@ -119,7 +119,7 @@ static int vfio_mdev_probe(struct mdev_device *mdev)
return -ENOMEM;
vfio_init_group_dev(vdev, &mdev->dev, &vfio_mdev_dev_ops);
- ret = vfio_register_group_dev(vdev);
+ ret = vfio_register_emulated_iommu_dev(vdev);
if (ret)
goto out_uninit;