Re: [PATCH 30/31] vdpa: Move vhost_vdpa_get_iova_range to net/vhost-vdpa.c

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Since it's a device property, it can be done in net/. This helps SVQ to allocate the rings in vdpa device initialization, rather than delay that. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 15 --- net/vhost-vdpa.c | 32

Re: [PATCH 29/31] vdpa: Make ncs autofree

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Simplifying memory management. Signed-off-by: Eugenio Pérez To reduce the size of this series. This can be sent as an separate patch if I was not wrong. Thanks --- net/vhost-vdpa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

Re: [PATCH 28/31] vdpa: Expose VHOST_F_LOG_ALL on SVQ

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: SVQ is able to log the dirty bits by itself, so let's use it to not block migration. Also, ignore set and clear of VHOST_F_LOG_ALL on set_features if SVQ is enabled. Even if the device supports it, the reports would be nonsense because SVQ memory is in the

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: @@ -272,6 +590,28 @@ void vhost_svq_set_svq_kick_fd(VhostShadowVirtqueue *svq, int svq_kick_fd) void vhost_svq_stop(VhostShadowVirtqueue *svq) { event_notifier_set_handler(>svq_kick, NULL); +g_autofree VirtQueueElement *next_avail_elem =

Re: [PATCH 23/31] vdpa: Add custom IOTLB translations to SVQ

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Use translations added in VhostIOVATree in SVQ. Only introduce usage here, not allocation and deallocation. As with previous patches, we use the dead code paths of shadow_vqs_enabled to avoid commiting too many changes at once. These are impossible to take

Re: [PATCH 22/31] vhost: Add VhostIOVATree

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This tree is able to look for a translated address from an IOVA address. At first glance it is similar to util/iova-tree. However, SVQ working on devices with limited IOVA space need more capabilities, So did the IOVA tree (e.g l2 vtd can only work in

Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-29 Thread Jason Wang
在 2022/1/24 下午5:20, Eugenio Perez Martin 写道: On Mon, Jan 24, 2022 at 5:33 AM Peter Xu wrote: On Fri, Jan 21, 2022 at 09:27:23PM +0100, Eugenio Pérez wrote: +int iova_tree_alloc(IOVATree *tree, DMAMap *map, hwaddr iova_begin, I forgot to s/iova_tree_alloc/iova_tree_alloc_map/ here. +

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Initial version of shadow virtqueue that actually forward buffers. There is no iommu support at the moment, and that will be addressed in future patches of this series. Since all vhost-vdpa devices use forced IOMMU, this means that SVQ is not usable at this

Re: [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: First half of the buffers forwarding part, preparing vhost-vdpa callbacks to SVQ to offer it. QEMU cannot enable it at this moment, so this is effectively dead code at the moment, but it helps to reduce patch size. Signed-off-by: Eugenio Pérez ---

Re: [PATCH 16/31] vhost: pass queue index to vhost_vq_get_addr

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Doing that way allows vhost backend to know what address to return. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index

Re: [PATCH 15/31] vdpa: Add vhost_svq_get_num

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This reports the guest's visible SVQ effective length, not the device's one. I think we need to explain if there could be a case that the SVQ size is not equal to the device queue size. Thanks Signed-off-by: Eugenio Pérez ---

Re: [PATCH 11/31] vhost: Add vhost_svq_valid_device_features to shadow vq

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This allows SVQ to negotiate features with the device. For the device, SVQ is a driver. While this function needs to bypass all non-transport features, it needs to disable the features that SVQ does not support when forwarding buffers. This includes packed

Re: [PATCH 09/31] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 18de14f0fb..029f98feee 100644 ---