HomeFreeBSD

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

Description

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

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).

Reviewed by: bryanv
Differential Revision: https://reviews.freebsd.org/D28070

Details

Provenance
jrtc27Authored on Jan 21 2021, 1:03 AM
Reviewer
bryanv
Differential Revision
D28070: virtio_mmio: Fix V1 device probing spec conformance (section 4.2.3.1.1)
Parents
rG0e72f2c54186: virtio_mmio: Fix a style(9) issue
Branches
Unknown
Tags
Unknown