Re: [RFC v3 15/29] vhost: Add enable_custom_iommu to VhostOps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




在 2021/5/20 上午12:28, Eugenio Pérez 写道:
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 <eperezma@xxxxxxxxxx>


I think there's probably no need to introduce this helper.

Instead, we can introduce ops like shadow_vq_start()/stop(). Then the details like this could be hided there.

(And hide the backend deatils (avoid calling vhost_vdpa_dma_map()) directly from the vhost.c)

Thanks


---
  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;

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux