qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vdpa: dont check vhost_vdpa->suspended when unsupported
@ 2023-06-07 17:08 Zhu Lingshan
  2023-06-07 13:51 ` Eugenio Perez Martin
  0 siblings, 1 reply; 10+ messages in thread
From: Zhu Lingshan @ 2023-06-07 17:08 UTC (permalink / raw)
  To: jasowang, eperezma; +Cc: qemu-devel, Zhu Lingshan

When read the state of a virtqueue, vhost_vdpa need
to check whether the device is suspended.

This commit verifies whether VHOST_BACKEND_F_SUSPEND is
negotiated when checking vhost_vdpa->suspended.

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
---
 hw/virtio/vhost-vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index b3094e8a8b..ae176c06dd 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1397,7 +1397,7 @@ static int vhost_vdpa_get_vring_base(struct vhost_dev *dev,
         return 0;
     }
 
-    if (!v->suspended) {
+    if ((dev->backend_cap & BIT_ULL(VHOST_BACKEND_F_SUSPEND)) && (!v->suspended)) {
         /*
          * Cannot trust in value returned by device, let vhost recover used
          * idx from guest.
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-06-09  8:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07 17:08 [PATCH] vdpa: dont check vhost_vdpa->suspended when unsupported Zhu Lingshan
2023-06-07 13:51 ` Eugenio Perez Martin
2023-06-08  7:07   ` Zhu, Lingshan
2023-06-08  8:49     ` Eugenio Perez Martin
2023-06-08  9:34       ` Zhu, Lingshan
2023-06-08 10:59         ` Eugenio Perez Martin
2023-06-08 13:19           ` Zhu, Lingshan
2023-06-08 14:38             ` Eugenio Perez Martin
2023-06-09  3:13   ` Jason Wang
2023-06-09  8:49     ` Zhu, Lingshan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).