summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/vfio.h
diff options
context:
space:
mode:
authorNicolin Chen <nicolinc@nvidia.com>2023-07-27 23:33:29 -0700
committerJason Gunthorpe <jgg@nvidia.com>2023-07-28 13:31:24 -0300
commitc157fd88619946cd62af47c45214c479749dad8d (patch)
tree20ea10c24eaa8f93163c30d1c668fb8a0a63f97d /include/uapi/linux/vfio.h
parentc154660b6e26c3f0670a49f43f1fafa5d65f6d39 (diff)
downloadlinux-c157fd88619946cd62af47c45214c479749dad8d.tar.gz
linux-c157fd88619946cd62af47c45214c479749dad8d.tar.bz2
linux-c157fd88619946cd62af47c45214c479749dad8d.zip
vfio: Support IO page table replacement
Now both the physical path and the emulated path can support an IO page table replacement. Call iommufd_device_replace/iommufd_access_replace(), when vdev->iommufd_attached is true. Also update the VFIO_DEVICE_ATTACH_IOMMUFD_PT kdoc in the uAPI header. Link: https://lore.kernel.org/r/b5f01956ff161f76aa52c95b0fa1ad6eaca95c4a.1690523699.git.nicolinc@nvidia.com Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include/uapi/linux/vfio.h')
-rw-r--r--include/uapi/linux/vfio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index fa06e3eb4955..537157ff8670 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -939,6 +939,12 @@ struct vfio_device_bind_iommufd {
* Undo by VFIO_DEVICE_DETACH_IOMMUFD_PT or device fd close. This is only
* allowed on cdev fds.
*
+ * If a vfio device is currently attached to a valid hw_pagetable, without doing
+ * a VFIO_DEVICE_DETACH_IOMMUFD_PT, a second VFIO_DEVICE_ATTACH_IOMMUFD_PT ioctl
+ * passing in another hw_pagetable (hwpt) id is allowed. This action, also known
+ * as a hw_pagetable replacement, will replace the device's currently attached
+ * hw_pagetable with a new hw_pagetable corresponding to the given pt_id.
+ *
* Return: 0 on success, -errno on failure.
*/
struct vfio_device_attach_iommufd_pt {