ed5979
From 46e80a9350a02fdb5689638df96bc7389e953cf8 Mon Sep 17 00:00:00 2001
ed5979
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
ed5979
Date: Tue, 17 Jan 2023 11:53:08 +0100
ed5979
Subject: [PATCH 13/14] vdpa: fix VHOST_BACKEND_F_IOTLB_ASID flag check
ed5979
MIME-Version: 1.0
ed5979
Content-Type: text/plain; charset=UTF-8
ed5979
Content-Transfer-Encoding: 8bit
ed5979
ed5979
RH-Author: Eugenio Pérez <eperezma@redhat.com>
ed5979
RH-MergeRequest: 136: vDPA ASID support in Qemu
ed5979
RH-Bugzilla: 2104412
ed5979
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ed5979
RH-Acked-by: Cindy Lu <lulu@redhat.com>
ed5979
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
ed5979
RH-Commit: [13/13] b7fb4b8e9ea26b6664a9179ed0a88376acf5115f (eperezmartin/qemu-kvm)
ed5979
ed5979
VHOST_BACKEND_F_IOTLB_ASID is the feature bit, not the bitmask. Since
ed5979
the device under test also provided VHOST_BACKEND_F_IOTLB_MSG_V2 and
ed5979
VHOST_BACKEND_F_IOTLB_BATCH, this went unnoticed.
ed5979
ed5979
Fixes: c1a1008685 ("vdpa: always start CVQ in SVQ mode if possible")
ed5979
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
ed5979
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
ed5979
Acked-by: Jason Wang <jasowang@redhat.com>
ed5979
Signed-off-by: Jason Wang <jasowang@redhat.com>
ed5979
ed5979
Upstream status: git@github.com:jasowang/qemu.git
ed5979
(cherry picked from commit 2bd492bca521ee8594f1d5db8dc9aac126fc4f85)
ed5979
---
ed5979
 net/vhost-vdpa.c | 2 +-
ed5979
 1 file changed, 1 insertion(+), 1 deletion(-)
ed5979
ed5979
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
ed5979
index 07d33dae26..7d9c4ea09d 100644
ed5979
--- a/net/vhost-vdpa.c
ed5979
+++ b/net/vhost-vdpa.c
ed5979
@@ -384,7 +384,7 @@ static int vhost_vdpa_net_cvq_start(NetClientState *nc)
ed5979
             g_strerror(errno), errno);
ed5979
         return -1;
ed5979
     }
ed5979
-    if (!(backend_features & VHOST_BACKEND_F_IOTLB_ASID) ||
ed5979
+    if (!(backend_features & BIT_ULL(VHOST_BACKEND_F_IOTLB_ASID)) ||
ed5979
         !vhost_vdpa_net_valid_svq_features(v->dev->features, NULL)) {
ed5979
         return 0;
ed5979
     }
ed5979
-- 
ed5979
2.31.1
ed5979