[SeaBIOS] [PATCH 0/7] kvmtool support for seabios

Gerd Hoffmann kraxel at redhat.com
Tue Jul 7 08:38:39 CEST 2015


Played around a bit with kvmtool.  Got annonyed because you can't just
pass it a guest image to boot from.  Decided to check what it takes to
run seabios in kvmtool, so it can load the guest kernel from the disk
image.  So, here are the results ...

There isn't much work involved at the seabios side.  Add a new config
option.  Tweak kconfig.  Some basic windup on the code.  Loads kernel
from disk.  Yea!  Success!

Well.  That only uncovers a bunch of issues in kvmtool ...

 (1) There seems to be no way to figure the amout of memory available.
     For now I've hardcoded 128 MB in seabios.  See patch #3.

 (2) Something corrupts virtio rings.  Not clear yet whenever seabios or
     kvmtool is at fault here.  See patch #7.

 (3) kvmtool doesn't emulate a pci host bridge.  Linux kernel is unhappy
     and throws an error on pci initialization.  kvmtool tackles that
     by appending "pci=conf1" to the command line when booting a kernel
     directly.  Which of course doesn't fly if you wanna boot the
     fedora cloud image downloaded from the internet as-is.  Booting the
     image once in qemu to tweak the boot loader config gets over it.

 (4) Linux kernel fails on virtio-blk initialization.  Bummer.  /me
     suspects kvmtool doesn't implement proper virtio device reset,
     so the device handover from seabios to linux kernel doesn't work.

So, the kernel boots fine but fails to mount the root filesystem.  After
a while dracut decides to not wait any longer for the root filesystem to
show up and drops into the emergency shell, where you can play around a


Patches also available in the git repository at:

  git://git.kraxel.org/seabios kvmtool

Gerd Hoffmann (7):
      kvmtool: initial support
      kvmtool: tweak kconfig for emulated hardware
      kvmtool: add (fake) ram detection
      kvmtool: detect pci devices
      kvmtool: uses mmio for legacy bar 0
      kvmtool: no keyboard, don't need boot menu
      kvmtool: support larger virtio queues

 Makefile             |  1 +
 src/Kconfig          | 24 ++++++++++++++++++++++--
 src/fw/paravirt.c    | 20 ++++++++++++++++++++
 src/fw/paravirt.h    |  3 +++
 src/hw/virtio-pci.c  | 11 ++++++++---
 src/hw/virtio-ring.h |  2 +-
 src/post.c           |  4 +++-
 7 files changed, 58 insertions(+), 7 deletions(-)

More information about the SeaBIOS mailing list