Page MenuHomeFreeBSD

virtio: Use bus_dma for ring and indirect buffer allocations
ClosedPublic

Authored by sarah.walker2_arm.com on Jan 30 2026, 11:14 AM.
Tags
None
Referenced Files
F154951361: D54959.diff
Thu, Apr 30, 7:05 AM
Unknown Object (File)
Wed, Apr 29, 3:19 AM
Unknown Object (File)
Wed, Apr 29, 3:12 AM
Unknown Object (File)
Mon, Apr 27, 9:51 PM
Unknown Object (File)
Mon, Apr 27, 5:58 AM
Unknown Object (File)
Sat, Apr 25, 10:37 AM
Unknown Object (File)
Sat, Apr 25, 5:07 AM
Unknown Object (File)
Sat, Apr 25, 3:15 AM

Details

Summary

While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Do we still need the mb()s? I would expect bus_dmamap_sync to suffice.

virtio_blk calls bus_dma_tag_set_iommu on PowerPC; would that not be needed for these new tags?

virtio_blk calls bus_dma_tag_set_iommu on PowerPC; would that not be needed for these new tags?

It looks like that was added in D37891 by @cperciva. Based on the commit message we could add it here, but can't test.

This revision is now accepted and ready to land.Feb 24 2026, 5:05 PM