Page MenuHomeFreeBSD

virtio_blk: Use bus_dma for command/ack buffer allocations
Needs ReviewPublic

Authored by sarah.walker2_arm.com on Fri, Jan 30, 11:14 AM.
Tags
None
Referenced Files
F145746618: D54960.diff
Mon, Feb 23, 9:54 PM
Unknown Object (File)
Fri, Feb 20, 3:46 PM
Unknown Object (File)
Thu, Feb 19, 7:27 PM
Unknown Object (File)
Wed, Feb 18, 9:55 AM
Unknown Object (File)
Wed, Feb 18, 3:14 AM
Unknown Object (File)
Sun, Feb 15, 3:52 AM
Unknown Object (File)
Thu, Feb 5, 4:29 PM
Unknown Object (File)
Sat, Jan 31, 3:15 AM
Subscribers

Details

Reviewers
bryanv
andrew
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 70726
Build 67609: arc lint + arc unit

Event Timeline

br added inline comments.
sys/dev/virtio/block/virtio_blk.c
1009

looks like the tag/map mismatch and below

sys/dev/virtio/block/virtio_blk.c
1012

one more mismatch

sys/dev/virtio/block/virtio_blk.c
956–957

panic() calls left from debugging have to be removed

Remove panic() calls, fix error handling.

sys/dev/virtio/block/virtio_blk.c
452

I expect we will need to put the new tags here too.

sys/dev/virtio/block/virtio_blk.c
452

Another option is to remove this call ? With the patch adding bus DMA support, the addresses in the descriptors rings are now bus addresses rather than physical ones, which is what the IOMMU expects.
Unlike ARM64 and RISC-V, the powerpc busdma backend implements iommu operation within the main busdma backend, not as external one found in sys/dev/iommu

sys/dev/virtio/block/virtio_blk.c
452

It was added in D37891, so presumably they need to be physical addresses on PowerPC.