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
Unknown Object (File)
Sat, Aug 8, 8:49 PM
Unknown Object (File)
Sat, Aug 8, 5:30 PM
Unknown Object (File)
Sat, Aug 8, 4:48 PM
Unknown Object (File)
Sat, Aug 8, 4:25 PM
Unknown Object (File)
Sat, Aug 8, 9:53 AM
Unknown Object (File)
Fri, Aug 7, 9:28 PM
Unknown Object (File)
Wed, Aug 5, 8:38 PM
Unknown Object (File)
Wed, Aug 5, 6:43 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