vfio: Add VFIO_DEVICE_BIND_IOMMUFD
authorYi Liu <yi.l.liu@intel.com>
Tue, 18 Jul 2023 13:55:47 +0000 (06:55 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Jul 2023 16:20:32 +0000 (10:20 -0600)
commit5fcc26969a164e6a3154bb68badd6712716eb954
tree16c2faf6f76c4d27a6b067e44fd21ffff8a12cce
parentca9e45b414709b9a7279d396ec3d338b057349a8
vfio: Add VFIO_DEVICE_BIND_IOMMUFD

This adds ioctl for userspace to bind device cdev fd to iommufd.

    VFIO_DEVICE_BIND_IOMMUFD: bind device to an iommufd, hence gain DMA
      control provided by the iommufd. open_device
      op is called after bind_iommufd op.

Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Yanting Jiang <yanting.jiang@intel.com>
Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Tested-by: Terrence Xu <terrence.xu@intel.com>
Tested-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20230718135551.6592-23-yi.l.liu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/device_cdev.c
drivers/vfio/vfio.h
drivers/vfio/vfio_main.c
include/linux/vfio.h
include/uapi/linux/vfio.h