[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 26/31] vdpa: Clear VHOST_VRING_F_LOG at vhost_vdpa_set_vring_addr
From: |
Eugenio Pérez |
Subject: |
[PATCH 26/31] vdpa: Clear VHOST_VRING_F_LOG at vhost_vdpa_set_vring_addr in SVQ |
Date: |
Fri, 21 Jan 2022 21:27:28 +0100 |
Doing so would cause the device to export writes to SVQ addresses, which
are not part of the guest's IOVA.
Like the previous patch, this is currently not possible since SVQ does
not run if the device exports VHOST_VRING_F_LOG. But it's needed to
enable migration with SVQ.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-vdpa.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 887857c177..ab729b3371 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -660,10 +660,16 @@ static int vhost_vdpa_set_log_base(struct vhost_dev *dev,
uint64_t base,
static int vhost_vdpa_set_vring_addr(struct vhost_dev *dev,
struct vhost_vring_addr *addr)
{
+ struct vhost_vdpa *v = dev->opaque;
+
trace_vhost_vdpa_set_vring_addr(dev, addr->index, addr->flags,
addr->desc_user_addr, addr->used_user_addr,
addr->avail_user_addr,
addr->log_guest_addr);
+
+ if (v->shadow_vqs_enabled) {
+ addr->flags &= ~BIT_ULL(VHOST_VRING_F_LOG);
+ }
return vhost_vdpa_call(dev, VHOST_SET_VRING_ADDR, addr);
}
--
2.27.0
[PATCH 20/31] util: Store DMA entries in a list, Eugenio Pérez, 2022/01/21
[PATCH 22/31] vhost: Add VhostIOVATree, Eugenio Pérez, 2022/01/21
[PATCH 24/31] vhost: Add vhost_svq_get_last_used_idx, Eugenio Pérez, 2022/01/21
[PATCH 23/31] vdpa: Add custom IOTLB translations to SVQ, Eugenio Pérez, 2022/01/21
[PATCH 25/31] vdpa: Adapt vhost_vdpa_get_vring_base to SVQ, Eugenio Pérez, 2022/01/21
[PATCH 26/31] vdpa: Clear VHOST_VRING_F_LOG at vhost_vdpa_set_vring_addr in SVQ,
Eugenio Pérez <=
[PATCH 27/31] vdpa: Never set log_base addr if SVQ is enabled, Eugenio Pérez, 2022/01/21
[PATCH 28/31] vdpa: Expose VHOST_F_LOG_ALL on SVQ, Eugenio Pérez, 2022/01/21
[PATCH 29/31] vdpa: Make ncs autofree, Eugenio Pérez, 2022/01/21
[PATCH 30/31] vdpa: Move vhost_vdpa_get_iova_range to net/vhost-vdpa.c, Eugenio Pérez, 2022/01/21
[PATCH 31/31] vdpa: Add x-svq to NetdevVhostVDPAOptions, Eugenio Pérez, 2022/01/21
Re: [PATCH 00/31] vDPA shadow virtqueue, Jason Wang, 2022/01/28