diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index eb95daa3e5a52314e6d9a857ddcd5591b395c654..55e5aa662ad59d4b72c44db743198876654f2d2d 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2233,6 +2233,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),