Page MenuHomeFreeBSD

virtio_mmio: Fix V1 device probing spec conformance (section 4.2.3.1.1)
Needs ReviewPublic

Authored by jrtc27 on Sat, Jan 9, 9:35 PM.

Details

Reviewers
bryanv
imp
Summary

We must check MagicValue not just Version before anything else, and then
we must check DeviceID and immediately abort if zero (and this must not
be an error).

Do all this when probing rather than at the start of attaching as that's
where this belongs, and provides a clear boundary between the device
detection and device initialisation parts of the specified driver
initialisation process. This also means we don't create empty device
instances for placeholder devices, reducing clutter on systems that
pre-allocate a large number, such as QEMU's AArch64 virt machine (which
provides 32).

Test Plan

Tested both ACPI (arm64) and FDT (riscv) on QEMU.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 36069
Build 32958: arc lint + arc unit