On Fri, Nov 20, 2020 at 07:50:58PM +0100, Eugenio Pérez wrote:
quoted hunk
@@ -1028,6 +1061,7 @@ static int vhost_sw_live_migration_start(struct vhost_dev *dev)
for (idx = 0; idx < dev->nvqs; ++idx) {
struct vhost_virtqueue *vq = &dev->vqs[idx];
+ unsigned num = virtio_queue_get_num(dev->vdev, idx);
struct vhost_vring_addr addr = {
.index = idx,
};@@ -1044,6 +1078,12 @@ static int vhost_sw_live_migration_start(struct vhost_dev *dev)
r = dev->vhost_ops->vhost_set_vring_addr(dev, &addr);
assert(r == 0);
+ r = vhost_backend_update_device_iotlb(dev, addr.used_user_addr,
+ addr.used_user_addr,
+ sizeof(vring_used_elem_t) * num,
+ IOMMU_RW);
I don't remember seeing iotlb setup for the rest of the vring or guest
memory. Maybe this should go into a single patch so it's easy to review
the iova space layout.