586cba
From 773d1bb4e9ea9ca704372e52569955937f91f15c Mon Sep 17 00:00:00 2001
586cba
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
586cba
Date: Tue, 23 Aug 2022 20:30:28 +0200
586cba
Subject: [PATCH 13/23] vhost: Delete useless read memory barrier
586cba
MIME-Version: 1.0
586cba
Content-Type: text/plain; charset=UTF-8
586cba
Content-Transfer-Encoding: 8bit
586cba
586cba
RH-Author: Eugenio Pérez <eperezma@redhat.com>
586cba
RH-MergeRequest: 116: vdpa: Restore device state on destination
586cba
RH-Bugzilla: 2114060
586cba
RH-Acked-by: Cindy Lu <lulu@redhat.com>
586cba
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
586cba
RH-Commit: [12/21] 0e238fe934b1fc2c7e10b6f693468bc25ea3243f (eperezmartin/qemu-kvm)
586cba
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2114060
586cba
Upstream status: git@github.com:jasowang/qemu.git net-next
586cba
586cba
As discussed in previous series [1], this memory barrier is useless with
586cba
the atomic read of used idx at vhost_svq_more_used. Deleting it.
586cba
586cba
[1] https://lists.nongnu.org/archive/html/qemu-devel/2022-07/msg02616.html
586cba
586cba
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
586cba
Acked-by: Jason Wang <jasowang@redhat.com>
586cba
Signed-off-by: Jason Wang <jasowang@redhat.com>
586cba
(cherry picked from commit cdfb1612ba0f9b76367c96ce26ba94fedc7a0e61)
586cba
---
586cba
 hw/virtio/vhost-shadow-virtqueue.c | 3 ---
586cba
 1 file changed, 3 deletions(-)
586cba
586cba
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
586cba
index 7792f3db1d..d36afbc547 100644
586cba
--- a/hw/virtio/vhost-shadow-virtqueue.c
586cba
+++ b/hw/virtio/vhost-shadow-virtqueue.c
586cba
@@ -509,9 +509,6 @@ size_t vhost_svq_poll(VhostShadowVirtqueue *svq)
586cba
         if (unlikely(g_get_monotonic_time() - start_us > 10e6)) {
586cba
             return 0;
586cba
         }
586cba
-
586cba
-        /* Make sure we read new used_idx */
586cba
-        smp_rmb();
586cba
     } while (true);
586cba
 }
586cba
 
586cba
-- 
586cba
2.31.1
586cba