diff --git a/hw/virtio.c b/hw/virtio.c index bb994c9b51..5615b59a6c 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -209,6 +209,10 @@ void virtio_queue_set_notification(VirtQueue *vq, int enable) } else { vring_used_flags_set_bit(vq, VRING_USED_F_NO_NOTIFY); } + if (enable) { + /* Expose avail event/used flags before caller checks the avail idx. */ + smp_mb(); + } } int virtio_queue_ready(VirtQueue *vq)