diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index ffdd4e937d1d..97518685ab58 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2231,6 +2231,8 @@ int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, return -EFAULT; } if (unlikely(vq->log_used)) { + /* Make sure used idx is seen before log. */ + smp_wmb(); /* Log used index update. */ log_write(vq->log_base, vq->log_addr + offsetof(struct vring_used, idx),