Page MenuHomeFreeBSD

virtio_mmio: Support non-transitional version 2 devices
ClosedPublic

Authored by jrtc27 on May 4 2020, 1:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 23, 6:29 AM
Unknown Object (File)
Thu, Dec 11, 11:23 AM
Unknown Object (File)
Nov 23 2025, 6:15 PM
Unknown Object (File)
Nov 20 2025, 8:10 PM
Unknown Object (File)
Nov 20 2025, 8:06 PM
Unknown Object (File)
Nov 20 2025, 8:02 PM
Unknown Object (File)
Nov 20 2025, 7:56 PM
Unknown Object (File)
Nov 18 2025, 12:26 PM

Details

Summary

The non-legacy virtio MMIO specification drops the use of PFNs and
replaces them with physical addresses. Whilst many implementations are
so-called transitional devices, also implementing the legacy
specification, TinyEMU does not. Device-specific configuration registers
have also changed to being little-endian, and must be accessed using a
single aligned access for registers up to 32 bits, and two 32-bit
aligned accesses for 64-bit registers.

(rwatson: Adding TinyEMU URL: https://bellard.org/tinyemu/)

Test Plan

Still boots a riscv64 kernel on QEMU. Needs testing with QEMU's legacy MMIO
disabled. Also boots on a TinyEMU-derived system that previously did not boot.
However, TinyEMU itself will not work, since it does not generate responses for
unrecognised block request types, rather than giving VIRTIO_BLK_S_UNSUPP, so
our VIRTIO_BLK_T_GET_ID on boot never completes and we wait forever.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jrtc27 requested review of this revision.May 4 2020, 1:06 AM
rwatson added subscribers: brooks, jhb, trasz.
rwatson added a subscriber: bryanv.

Looks good at a glance. Adding a couple more potential reviewers.

I tested in tinyemu. It works.
(tinyemu supports version 2 only)

This revision is now accepted and ready to land.May 6 2020, 10:48 AM