]> git.proxmox.com Git - qemu.git/blobdiff - hw/virtio.c
virtio: add missing mb() on notification
[qemu.git] / hw / virtio.c
index 314abf8a18d744c660da720e9f64ef9c019e468a..bb994c9b5191bc7c3defa2a3a5a166d8760f6ff3 100644 (file)
@@ -700,6 +700,8 @@ static bool vring_notify(VirtIODevice *vdev, VirtQueue *vq)
 {
     uint16_t old, new;
     bool v;
+    /* We need to expose used array entries before checking used event. */
+    smp_mb();
     /* Always notify when queue is empty (when feature acknowledge) */
     if (((vdev->guest_features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) &&
          !vq->inuse && vring_avail_idx(vq) == vq->last_avail_idx)) {