mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
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>
This commit is contained in:
@@ -1374,6 +1374,9 @@ static const struct vfio_device_ops mbochs_dev_ops = {
|
||||
.write = mbochs_write,
|
||||
.ioctl = mbochs_ioctl,
|
||||
.mmap = mbochs_mmap,
|
||||
.bind_iommufd = vfio_iommufd_emulated_bind,
|
||||
.unbind_iommufd = vfio_iommufd_emulated_unbind,
|
||||
.attach_ioas = vfio_iommufd_emulated_attach_ioas,
|
||||
};
|
||||
|
||||
static struct mdev_driver mbochs_driver = {
|
||||
|
@@ -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 = {
|
||||
|
@@ -1269,6 +1269,9 @@ static const struct vfio_device_ops mtty_dev_ops = {
|
||||
.read = mtty_read,
|
||||
.write = mtty_write,
|
||||
.ioctl = mtty_ioctl,
|
||||
.bind_iommufd = vfio_iommufd_emulated_bind,
|
||||
.unbind_iommufd = vfio_iommufd_emulated_unbind,
|
||||
.attach_ioas = vfio_iommufd_emulated_attach_ioas,
|
||||
};
|
||||
|
||||
static struct mdev_driver mtty_driver = {
|
||||
|
Reference in New Issue
Block a user