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)
Mon, Mar 2, 6:25 PM
Unknown Object (File)
Sat, Feb 28, 10:21 PM
Unknown Object (File)
Sat, Feb 28, 3:57 PM
Unknown Object (File)
Sat, Feb 28, 1:09 PM
Unknown Object (File)
Sat, Feb 28, 11:49 AM
Unknown Object (File)
Tue, Feb 24, 6:06 AM
Unknown Object (File)
Mon, Feb 23, 9:54 PM
Unknown Object (File)
Wed, Feb 18, 11:19 PM

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.Tue, Feb 24, 5:05 PM