This series enable vhost (And vhost-vdpa) notifications forwarding for software assisted live migration, implemented through a shadow virtqueue.
Shadow virtqueue is a new method of tracking memory for migration: Instead of relay on vDPA device's dirty logging capability, SW assisted LM intercepts dataplane, forwarding the descriptors between VM and device. In this migration mode, qemu offers a new (shadow) vring to the device to read and write into, and forwards descriptors between host vring and qemu one. On used buffer relay, qemu will mark the dirty memory as with plain virtio-net devices. This way, devices does not need to have dirty page logging capability. This RFC series just enables just the notifications forwarding part, not buffer forwarding/tracking. It is based on the ideas of DPDK SW assisted LM, in the series of DPDK's https://patchwork.dpdk.org/cover/48370/ , but will use memory in qemu Virtual Address Space for rings, instead of in guest's. Comments are welcome. Thanks! v2: Fix non matching comments on qapi/net.json (Eric). Delete virtio_queue_get_idx and use already available virtio_get_queue_index (Jason). Do not check on used notification enable flag, since we need to particularize for each virtqueue layout and IOMMU, and it is unlikely for this code to be in final version. Handle multiqueue devices. Delete trailing dot in previous errpr_setg argument Main changes from previous RFC [1] are: * Use QMP to enable. Can disable through QMP too. * Do not use vhost_dev_{enable,disable}_notifiers, since they override the VM ioeventfd set, and could cause race conditions. Do never modify irqfd or ioeventfd used for the guest. [1] https://patchew.org/QEMU/20201120185105.279030-1-epere...@redhat.com/ Eugenio Pérez (7): vhost: Delete trailing dot in errpr_setg argument virtio: Add virtio_queue_host_notifier_status vhost: Save masked_notifier state vhost: Add VhostShadowVirtqueue vhost: Add x-vhost-enable-shadow-vq qmp vhost: Route guest->host notification through shadow virtqueue vhost: Route host->guest notification through shadow virtqueue qapi/net.json | 22 ++++ hw/virtio/vhost-shadow-virtqueue.h | 33 +++++ include/hw/virtio/vhost.h | 5 + include/hw/virtio/virtio.h | 1 + hw/virtio/vhost-shadow-virtqueue.c | 205 +++++++++++++++++++++++++++++ hw/virtio/vhost.c | 159 +++++++++++++++++++++- hw/virtio/virtio.c | 5 + hw/virtio/meson.build | 2 +- 8 files changed, 430 insertions(+), 2 deletions(-) create mode 100644 hw/virtio/vhost-shadow-virtqueue.h create mode 100644 hw/virtio/vhost-shadow-virtqueue.c -- 2.27.0