7f1c5b
From cb974f2f9a0c5b9520b6ac80bd1d1e4a6b12bbdc Mon Sep 17 00:00:00 2001
7f1c5b
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
7f1c5b
Date: Thu, 15 Dec 2022 12:31:33 +0100
7f1c5b
Subject: [PATCH 01/14] vdpa: use v->shadow_vqs_enabled in
7f1c5b
 vhost_vdpa_svqs_start & stop
7f1c5b
MIME-Version: 1.0
7f1c5b
Content-Type: text/plain; charset=UTF-8
7f1c5b
Content-Transfer-Encoding: 8bit
7f1c5b
7f1c5b
RH-Author: Eugenio Pérez <eperezma@redhat.com>
7f1c5b
RH-MergeRequest: 136: vDPA ASID support in Qemu
7f1c5b
RH-Bugzilla: 2104412
7f1c5b
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
7f1c5b
RH-Acked-by: Cindy Lu <lulu@redhat.com>
7f1c5b
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
7f1c5b
RH-Commit: [1/13] f0db50a95f87dd011418617be7b80aa6813a1146 (eperezmartin/qemu-kvm)
7f1c5b
7f1c5b
This function used to trust in v->shadow_vqs != NULL to know if it must
7f1c5b
start svq or not.
7f1c5b
7f1c5b
This is not going to be valid anymore, as qemu is going to allocate svq
7f1c5b
array unconditionally (but it will only start them conditionally).
7f1c5b
7f1c5b
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
7f1c5b
Acked-by: Jason Wang <jasowang@redhat.com>
7f1c5b
Message-Id: <20221215113144.322011-2-eperezma@redhat.com>
7f1c5b
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
7f1c5b
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7f1c5b
(cherry picked from commit 712c1a3171cf62d501dac5af58f77d5fea70350d)
7f1c5b
---
7f1c5b
 hw/virtio/vhost-vdpa.c | 4 ++--
7f1c5b
 1 file changed, 2 insertions(+), 2 deletions(-)
7f1c5b
7f1c5b
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
7f1c5b
index c5be2645b0..44e6a9b7b3 100644
7f1c5b
--- a/hw/virtio/vhost-vdpa.c
7f1c5b
+++ b/hw/virtio/vhost-vdpa.c
7f1c5b
@@ -1036,7 +1036,7 @@ static bool vhost_vdpa_svqs_start(struct vhost_dev *dev)
7f1c5b
     Error *err = NULL;
7f1c5b
     unsigned i;
7f1c5b
 
7f1c5b
-    if (!v->shadow_vqs) {
7f1c5b
+    if (!v->shadow_vqs_enabled) {
7f1c5b
         return true;
7f1c5b
     }
7f1c5b
 
7f1c5b
@@ -1089,7 +1089,7 @@ static void vhost_vdpa_svqs_stop(struct vhost_dev *dev)
7f1c5b
 {
7f1c5b
     struct vhost_vdpa *v = dev->opaque;
7f1c5b
 
7f1c5b
-    if (!v->shadow_vqs) {
7f1c5b
+    if (!v->shadow_vqs_enabled) {
7f1c5b
         return;
7f1c5b
     }
7f1c5b
 
7f1c5b
-- 
7f1c5b
2.31.1
7f1c5b