[OpenBIOS] [PATCH v3 0/4] Add virtio-blk driver support

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Aug 26 17:14:24 CEST 2018


These patches add support for booting from virtio-blk (PCI) devices as
used by QEMU.

Patches 1 and 2 add bootindex support which is the new way for passing
boot order information from QEMU to OpenBIOS. Note that there are also
corresponding patches for QEMU required, without which the generated
device paths will be incorrect and cause virtio boot to fail.

Patch 3 adds the virtio-1.0 compliant virtio-blk PCI driver.

Patch 4 enables the new driver for both PPC and SPARC64 architectures
so that virtio-blk-pci devices will be usable out-of-the-box with QEMU.

Once these patches have been applied to OpenBIOS (along with the
corresponding fw path fixes for QEMU) it is possible to boot from
virtio-blk-pci devices like this:

PPC:

./qemu-system-ppc -drive file=debian-9.0-powerpc-NETINST.iso,if=none,index=0,id=cd,media=cdrom \
    -device virtio-blk-pci,drive=cd,bootindex=0 -m 256 -boot d

SPARC:

./qemu-system-sparc64 -drive debian-9.0-sparc64-NETINST.iso,if=none,index=0,id=cd,media=cdrom \
    -device virtio-blk-pci,bus=pciB,drive=cd,bootindex=0 -m 256 -boot d -nographic


Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

v3:
- Rebase onto master
- Convert from legacy driver to virtio-1.0 driver

v2:
- Switch over to using dma-* words to allocate rings and descriptors
- Fix up some minor whitespace issues


Mark Cave-Ayland (4):
  ppc: add bootindex support
  SPARC64: add bootindex support
  drivers: add virtio-1.0 virtio-blk driver
  config: enable virtio-blk driver for default PPC and SPARC64 builds

 arch/ppc/qemu/init.c               |  55 +++-
 arch/sparc64/boot.c                |   2 +-
 arch/sparc64/boot.h                |   2 +-
 arch/sparc64/openbios.c            |  38 ++-
 config/examples/ppc_config.xml     |   1 +
 config/examples/sparc64_config.xml |   1 +
 drivers/build.xml                  |   1 +
 drivers/pci.c                      |  63 +++++
 drivers/pci_database.c             |  14 +-
 drivers/pci_database.h             |   1 +
 drivers/virtio.c                   | 555 +++++++++++++++++++++++++++++++++++++
 drivers/virtio.h                   | 370 +++++++++++++++++++++++++
 include/drivers/drivers.h          |   5 +
 include/drivers/pci.h              |   6 +
 14 files changed, 1093 insertions(+), 21 deletions(-)
 create mode 100644 drivers/virtio.c
 create mode 100644 drivers/virtio.h

-- 
2.11.0




More information about the OpenBIOS mailing list