This operation enable the backend-specific IOTLB entries. If a backend support this, it start managing its own entries, and vhost can disable it through this operation and recover control.
Every enable/disable operation must also clear all IOTLB device entries. At the moment, the only backend that does so is vhost-vdpa. To fully support these, vdpa needs also to expose a way for vhost subsystem to map and unmap entries. This will be done in future commits. Signed-off-by: Eugenio Pérez <epere...@redhat.com> --- include/hw/virtio/vhost-backend.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h index bcb112c166..f8eed2ace5 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -128,6 +128,9 @@ typedef bool (*vhost_force_iommu_op)(struct vhost_dev *dev); typedef int (*vhost_vring_pause_op)(struct vhost_dev *dev); +typedef int (*vhost_enable_custom_iommu_op)(struct vhost_dev *dev, + bool enable); + typedef int (*vhost_get_iova_range)(struct vhost_dev *dev, hwaddr *first, hwaddr *last); @@ -177,6 +180,7 @@ typedef struct VhostOps { vhost_get_device_id_op vhost_get_device_id; vhost_vring_pause_op vhost_vring_pause; vhost_force_iommu_op vhost_force_iommu; + vhost_enable_custom_iommu_op vhost_enable_custom_iommu; vhost_get_iova_range vhost_get_iova_range; } VhostOps; -- 2.27.0