[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v3 29/29] vhost: Start vhost-vdpa SVQ directly
From: |
Eugenio Pérez |
Subject: |
[RFC v3 29/29] vhost: Start vhost-vdpa SVQ directly |
Date: |
Wed, 19 May 2021 18:29:03 +0200 |
Since it does not have sense to keep a non-working vdpa device, start
directly in SVQ mode.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 286863ad42..fd812e1a80 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1386,7 +1386,6 @@ static bool vhost_sw_live_migration_start_vq(struct
vhost_dev *dev,
assert(r == VHOST_DMA_MAP_OK);
}
- vhost_virtqueue_stop(dev, dev->vdev, &dev->vqs[idx], dev->vq_index + idx);
/* TODO: Why cannot make this read only? */
r = vhost_vdpa_dma_map(dev->opaque, addr.desc_user_addr,
driver_region.size,
(void *)driver_region.translated_addr, false);
@@ -1467,6 +1466,11 @@ static int vhost_sw_live_migration_start(struct
vhost_dev *dev)
/* Can be read by vhost_virtqueue_mask, from vm exit */
dev->shadow_vqs_enabled = true;
+
+ /* Reset device, so SVQ can assign its address */
+ r = dev->vhost_ops->vhost_dev_start(dev, false);
+ assert(r == 0);
+
for (idx = 0; idx < dev->nvqs; ++idx) {
bool ok = vhost_sw_live_migration_start_vq(dev, idx);
if (unlikely(!ok)) {
@@ -2107,6 +2111,8 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice
*vdev)
vhost_device_iotlb_miss(hdev, vq->used_phys, true);
}
}
+
+ vhost_sw_live_migration_start(hdev);
return 0;
fail_log:
vhost_log_put(hdev, false);
--
2.27.0
- [RFC v3 19/29] vhost: Check for device VRING_USED_F_NO_NOTIFY at shadow virtqueue kick, (continued)
- [RFC v3 19/29] vhost: Check for device VRING_USED_F_NO_NOTIFY at shadow virtqueue kick, Eugenio Pérez, 2021/05/19
- [RFC v3 20/29] vhost: Use VRING_AVAIL_F_NO_INTERRUPT at device call on shadow virtqueue, Eugenio Pérez, 2021/05/19
- [RFC v3 21/29] vhost: Add VhostIOVATree, Eugenio Pérez, 2021/05/19
- [RFC v3 22/29] vhost: Add iova_rev_maps_find_iova to IOVAReverseMaps, Eugenio Pérez, 2021/05/19
- [RFC v3 23/29] vhost: Use a tree to store memory mappings, Eugenio Pérez, 2021/05/19
- [RFC v3 24/29] vhost: Add iova_rev_maps_alloc, Eugenio Pérez, 2021/05/19
- [RFC v3 25/29] vhost: Add custom IOTLB translations to SVQ, Eugenio Pérez, 2021/05/19
- [RFC v3 26/29] vhost: Map in vdpa-dev, Eugenio Pérez, 2021/05/19
- [RFC v3 27/29] vhost-vdpa: Implement vhost_vdpa_vring_pause operation, Eugenio Pérez, 2021/05/19
- [RFC v3 28/29] vhost-vdpa: never map with vDPA listener, Eugenio Pérez, 2021/05/19
- [RFC v3 29/29] vhost: Start vhost-vdpa SVQ directly,
Eugenio Pérez <=
- Re: [RFC v3 00/29] vDPA software assisted live migration, Michael S. Tsirkin, 2021/05/24