qemu-kvm/kvm-vdpa-Fix-bad-index-calculus-at-vhost_vdpa_get_vring_.patch
Miroslav Rezanina 85d5f0ed1b * Mon Aug 15 2022 Miroslav Rezanina <mrezanin@redhat.com> - 7.0.0-11
- kvm-QIOChannelSocket-Fix-zero-copy-flush-returning-code-.patch [bz#2107466]
- kvm-Add-dirty-sync-missed-zero-copy-migration-stat.patch [bz#2107466]
- kvm-migration-multifd-Report-to-user-when-zerocopy-not-w.patch [bz#2107466]
- kvm-migration-Avoid-false-positive-on-non-supported-scen.patch [bz#2107466]
- kvm-migration-add-remaining-params-has_-true-in-migratio.patch [bz#2107466]
- kvm-QIOChannelSocket-Add-support-for-MSG_ZEROCOPY-IPV6.patch [bz#2107466]
- kvm-pc-bios-s390-ccw-Fix-booting-with-logical-block-size.patch [bz#2112303]
- kvm-vdpa-Fix-bad-index-calculus-at-vhost_vdpa_get_vring_.patch [bz#2116876]
- kvm-vdpa-Fix-index-calculus-at-vhost_vdpa_svqs_start.patch [bz#2116876]
- kvm-vdpa-Fix-memory-listener-deletions-of-iova-tree.patch [bz#2116876]
- kvm-vdpa-Fix-file-descriptor-leak-on-get-features-error.patch [bz#2116876]
- Resolves: bz#2107466
  (zerocopy capability can be enabled when set migrate capabilities with multifd and compress/xbzrle together)
- Resolves: bz#2112303
  (virtio-blk: Can't boot fresh installation from used 512 cluster_size image under certain conditions)
- Resolves: bz#2116876
  (Fixes for vDPA control virtqueue support in Qemu)
2022-08-15 07:19:39 -04:00

51 lines
1.9 KiB
Diff

From e19adb058502e24580dbc4f6f944cd951ca288ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Thu, 12 May 2022 19:57:44 +0200
Subject: [PATCH 08/11] vdpa: Fix bad index calculus at
vhost_vdpa_get_vring_base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Eugenio Pérez <eperezma@redhat.com>
RH-MergeRequest: 114: vdpa: Fix memory listener deletions of iova tree
RH-Commit: [1/4] 754fb8960684fa7a91bddb18c8df58c3b947ee75 (eperezmartin/qemu-kvm)
RH-Bugzilla: 2116876
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
Fixes: 6d0b222666 ("vdpa: Adapt vhost_vdpa_get_vring_base to SVQ")
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20220512175747.142058-4-eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 639036477ef890958415967e753ca2cbb348c16c)
---
hw/virtio/vhost-vdpa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index e3e5bce4bb..a7dfac530f 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1193,11 +1193,11 @@ static int vhost_vdpa_get_vring_base(struct vhost_dev *dev,
struct vhost_vring_state *ring)
{
struct vhost_vdpa *v = dev->opaque;
+ int vdpa_idx = ring->index - dev->vq_index;
int ret;
if (v->shadow_vqs_enabled) {
- VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs,
- ring->index);
+ VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, vdpa_idx);
/*
* Setting base as last used idx, so destination will see as available
--
2.31.1