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)
Sun, Sep 6, 6:45 AM
Unknown Object (File)
Sat, Sep 5, 5:01 PM
Unknown Object (File)
Sat, Sep 5, 5:01 PM
Unknown Object (File)
Thu, Sep 3, 1:27 PM
Unknown Object (File)
Wed, Sep 2, 1:40 PM
Unknown Object (File)
Mon, Aug 31, 2:37 AM
Unknown Object (File)
Sun, Aug 30, 4:03 PM
Unknown Object (File)
Thu, Aug 20, 3:06 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