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)
Fri, Oct 24, 1:05 PM
Unknown Object (File)
Mon, Oct 20, 5:01 PM
Unknown Object (File)
Mon, Oct 13, 12:07 PM
Unknown Object (File)
Sun, Oct 12, 11:26 PM
Unknown Object (File)
Sun, Oct 12, 11:26 PM
Unknown Object (File)
Sun, Oct 12, 11:26 PM
Unknown Object (File)
Sun, Oct 12, 11:59 AM
Unknown Object (File)
Sep 23 2025, 2:02 AM

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