aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah Walker <sarah.walker2@arm.com>2026-03-10 19:08:38 +0000
committerAndrew Turner <andrew@FreeBSD.org>2026-03-10 19:10:21 +0000
commit1a92fc9c1210f9c99a19fda5a86682a78d39872f (patch)
tree960efa35e11dab418f5c11007eb3bcb22aead4ce
parent522012c8bd079879b82aaa403e4da3c1ab9fc8a9 (diff)
virtio: Restore mb() calls
Until an issue seen on amd64 can be investigated restore two mb() calls to virtio. Reviewed by: andrew Fixes: c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations") Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55766
-rw-r--r--sys/dev/virtio/virtqueue.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/virtio/virtqueue.c b/sys/dev/virtio/virtqueue.c
index dbd55e02e091..b7fdb4703ccb 100644
--- a/sys/dev/virtio/virtqueue.c
+++ b/sys/dev/virtio/virtqueue.c
@@ -565,6 +565,9 @@ virtqueue_notify(struct virtqueue *vq)
/* Ensure updated avail->idx is visible to host. */
bus_dmamap_sync(vq->vq_ring_dmat, vq->vq_ring_mapp,
BUS_DMASYNC_PREWRITE);
+#if defined(__i386__) || defined(__amd64__)
+ mb();
+#endif
if (vq_ring_must_notify_host(vq))
vq_ring_notify_host(vq);
@@ -960,6 +963,9 @@ vq_ring_enable_interrupt(struct virtqueue *vq, uint16_t ndesc)
bus_dmamap_sync(vq->vq_ring_dmat, vq->vq_ring_mapp,
BUS_DMASYNC_PREWRITE);
+#if defined(__i386__) || defined(__amd64__)
+ mb();
+#endif
/*
* Enough items may have already been consumed to meet our threshold