thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-vdpa-fix-VHOST_BACKEND_F_IOTLB_ASID-flag-check.patch

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