diff options
| author | Christoph Hellwig <[email protected]> | 2021-09-24 17:56:57 +0200 |
|---|---|---|
| committer | Alex Williamson <[email protected]> | 2021-09-30 12:46:44 -0600 |
| commit | c68ea0d00ad82428154aed890ec9f793e460fa1c (patch) | |
| tree | 663fb526e33c3322c770c9a16097d26351d69534 /include/linux | |
| parent | c04ac34078a4d7c08e1218b548e0a6b197f01582 (diff) | |
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 <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/vfio.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/vfio.h b/include/linux/vfio.h index f7083c2fd0d0..bbe293008626 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -75,6 +75,7 @@ void vfio_init_group_dev(struct vfio_device *device, struct device *dev, const struct vfio_device_ops *ops); void vfio_uninit_group_dev(struct vfio_device *device); int vfio_register_group_dev(struct vfio_device *device); +int vfio_register_emulated_iommu_dev(struct vfio_device *device); void vfio_unregister_group_dev(struct vfio_device *device); extern struct vfio_device *vfio_device_get_from_dev(struct device *dev); extern void vfio_device_put(struct vfio_device *device); |