]> git.lizzy.rs Git - plan9front.git/commit
virtio: add non-legacy virtio 1.0 drivers for disk and ethernet
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 11 Jul 2021 11:24:13 +0000 (11:24 +0000)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 11 Jul 2021 11:24:13 +0000 (11:24 +0000)
commitf58d99aa7a97ba5f79af89f38b78d5924d4e35a2
tree42aeb9f910f45bee8073edf3fa118e28cced6af4
parentc3589ef3cf33189d342a3ab638b558fd9249b220
virtio: add non-legacy virtio 1.0 drivers for disk and ethernet

The new interface uses pci capability structures to locate the
registers in a rather fine granular way making it more complicated
as they can be located anywhere in any pci bar at any offset.

As far as i can see, qemu (6.0.50) never uses i/o bars in
non-legacy mode, so only mmio is implemented for now.

The previous virtio drivers implemented the legacy interface only
which uses i/o ports for all register accesses. This is still
the preferred method (and also qemu default) as it is easier to
emulate and most likely faster.

However, some vps providers like vultr force the legacy interface
to disabled with qemu -device option "disable-legacy=on" resulting
on a system without a disk and ethernet.
sys/src/9/pc/ethervirtio.c
sys/src/9/pc/ethervirtio10.c [new file with mode: 0644]
sys/src/9/pc/pc
sys/src/9/pc/sdvirtio.c
sys/src/9/pc/sdvirtio10.c [new file with mode: 0644]
sys/src/9/pc64/pc64