aboutsummaryrefslogtreecommitdiff
path: root/samples/vfio-mdev/mdpy.c
diff options
context:
space:
mode:
authorGravatar Yi Liu <yi.l.liu@intel.com> 2023-03-27 02:33:50 -0700
committerGravatar Jason Gunthorpe <jgg@nvidia.com> 2023-03-31 13:43:32 -0300
commit0a782d15e1d406e8074954405b1dc143a7645344 (patch)
tree29523857f6f4a91c485701c4bb225fdab21c7fc9 /samples/vfio-mdev/mdpy.c
parentvfio-iommufd: Make vfio_iommufd_emulated_bind() return iommufd_access ID (diff)
downloadlinux-0a782d15e1d406e8074954405b1dc143a7645344.tar.gz
linux-0a782d15e1d406e8074954405b1dc143a7645344.tar.bz2
linux-0a782d15e1d406e8074954405b1dc143a7645344.zip
vfio/mdev: Uses the vfio emulated iommufd ops set in the mdev sample drivers
This harmonizes the no-DMA devices (the vfio-mdev sample drivers) with the emulated devices (gvt-g, vfio-ap etc.). It makes it easier to add BIND_IOMMUFD user interface which requires to return an iommufd ID to represent the device/iommufd bond. Link: https://lore.kernel.org/r/20230327093351.44505-6-yi.l.liu@intel.com Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Tested-by: Terrence Xu <terrence.xu@intel.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'samples/vfio-mdev/mdpy.c')
-rw-r--r--samples/vfio-mdev/mdpy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/samples/vfio-mdev/mdpy.c b/samples/vfio-mdev/mdpy.c
index e8400fdab71d..5f48aef36995 100644
--- a/samples/vfio-mdev/mdpy.c
+++ b/samples/vfio-mdev/mdpy.c
@@ -663,6 +663,9 @@ static const struct vfio_device_ops mdpy_dev_ops = {
.write = mdpy_write,
.ioctl = mdpy_ioctl,
.mmap = mdpy_mmap,
+ .bind_iommufd = vfio_iommufd_emulated_bind,
+ .unbind_iommufd = vfio_iommufd_emulated_unbind,
+ .attach_ioas = vfio_iommufd_emulated_attach_ioas,
};
static struct mdev_driver mdpy_driver = {