Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Mar 2026 19:10:52 +0000
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Cc:        Sarah Walker <sarah.walker2@arm.com>
Subject:   git: 1a92fc9c1210 - main - virtio: Restore mb() calls
Message-ID:  <69b06cbc.244f4.657b42c@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=1a92fc9c1210f9c99a19fda5a86682a78d39872f

commit 1a92fc9c1210f9c99a19fda5a86682a78d39872f
Author:     Sarah Walker <sarah.walker2@arm.com>
AuthorDate: 2026-03-10 19:08:38 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2026-03-10 19:10:21 +0000

    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
---
 sys/dev/virtio/virtqueue.c | 6 ++++++
 1 file changed, 6 insertions(+)

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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69b06cbc.244f4.657b42c>