[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 10/18] vdpa: move iommu_list to vhost_vdpa_shared
|
From: |
Eugenio Pérez |
|
Subject: |
[RFC PATCH 10/18] vdpa: move iommu_list to vhost_vdpa_shared |
|
Date: |
Thu, 19 Oct 2023 16:34:47 +0200 |
Next patches will register the vhost_vdpa memory listener while the VM
is migrating at the destination, so we can map the memory to the device
before stopping the VM at the source. The main goal is to reduce the
downtime.
However, the destination QEMU is unaware of which vhost_vdpa device will
register its memory_listener. If the source guest has CVQ enabled, it
will be the CVQ device. Otherwise, it will be the first one.
Move the iommu_list member to VhostVDPAShared so all vhost_vdpa can use
it, rather than always in the first / last vhost_vdpa.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
include/hw/virtio/vhost-vdpa.h | 2 +-
hw/virtio/vhost-vdpa.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h
index 5bd964dac5..3880b9e7f2 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -34,6 +34,7 @@ typedef struct VhostVDPAHostNotifier {
typedef struct vhost_vdpa_shared {
int device_fd;
struct vhost_vdpa_iova_range iova_range;
+ QLIST_HEAD(, vdpa_iommu) iommu_list;
/* IOVA mapping used by the Shadow Virtqueue */
VhostIOVATree *iova_tree;
@@ -62,7 +63,6 @@ typedef struct vhost_vdpa {
struct vhost_dev *dev;
Error *migration_blocker;
VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX];
- QLIST_HEAD(, vdpa_iommu) iommu_list;
IOMMUNotifier n;
} VhostVDPA;
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 66ae8ff6f4..2295daa7cc 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -278,7 +278,7 @@ static void vhost_vdpa_iommu_region_add(MemoryListener
*listener,
return;
}
- QLIST_INSERT_HEAD(&v->iommu_list, iommu, iommu_next);
+ QLIST_INSERT_HEAD(&v->shared->iommu_list, iommu, iommu_next);
memory_region_iommu_replay(iommu->iommu_mr, &iommu->n);
return;
@@ -291,7 +291,7 @@ static void vhost_vdpa_iommu_region_del(MemoryListener
*listener,
struct vdpa_iommu *iommu;
- QLIST_FOREACH(iommu, &v->iommu_list, iommu_next)
+ QLIST_FOREACH(iommu, &v->shared->iommu_list, iommu_next)
{
if (MEMORY_REGION(iommu->iommu_mr) == section->mr &&
iommu->n.start == section->offset_within_region) {
--
2.39.3
- [RFC PATCH 00/18] Map memory at destination .load_setup in vDPA-net migration, Eugenio Pérez, 2023/10/19
- [RFC PATCH 04/18] vdpa: move shadow_data to vhost_vdpa_shared, Eugenio Pérez, 2023/10/19
- [RFC PATCH 01/18] vdpa: add VhostVDPAShared, Eugenio Pérez, 2023/10/19
- [RFC PATCH 02/18] vdpa: move iova tree to the shared struct, Eugenio Pérez, 2023/10/19
- [RFC PATCH 03/18] vdpa: move iova_range to vhost_vdpa_shared, Eugenio Pérez, 2023/10/19
- [RFC PATCH 05/18] vdpa: use vdpa shared for tracing, Eugenio Pérez, 2023/10/19
- [RFC PATCH 07/18] vdpa: move iotlb_batch_begin_sent to vhost_vdpa_shared, Eugenio Pérez, 2023/10/19
- [RFC PATCH 06/18] vdpa: move file descriptor to vhost_vdpa_shared, Eugenio Pérez, 2023/10/19
- [RFC PATCH 09/18] vdpa: remove msg type of vhost_vdpa, Eugenio Pérez, 2023/10/19
- [RFC PATCH 10/18] vdpa: move iommu_list to vhost_vdpa_shared,
Eugenio Pérez <=
- [RFC PATCH 11/18] vdpa: use VhostVDPAShared in vdpa_dma_map and unmap, Eugenio Pérez, 2023/10/19
- [RFC PATCH 08/18] vdpa: move backend_cap to vhost_vdpa_shared, Eugenio Pérez, 2023/10/19
- [RFC PATCH 13/18] vdpa: move memory listener to vhost_vdpa_shared, Eugenio Pérez, 2023/10/19
- [RFC PATCH 14/18] vdpa: do not set virtio status bits if unneeded, Eugenio Pérez, 2023/10/19
- [RFC PATCH 16/18] vdpa: add vhost_vdpa_net_load_setup NetClient callback, Eugenio Pérez, 2023/10/19
- [RFC PATCH 15/18] vdpa: add vhost_vdpa_load_setup, Eugenio Pérez, 2023/10/19
- [RFC PATCH 12/18] vdpa: use dev_shared in vdpa_iommu, Eugenio Pérez, 2023/10/19
- [RFC PATCH 17/18] vdpa: use shadow_data instead of first device v->shadow_vqs_enabled, Eugenio Pérez, 2023/10/19
- [RFC PATCH 18/18] virtio_net: register incremental migration handlers, Eugenio Pérez, 2023/10/19