qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU


From: Kevin O'Connor
Subject: Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU
Date: Fri, 22 May 2015 23:55:01 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, May 22, 2015 at 07:23:27PM -0400, Kevin O'Connor wrote:
> On Thu, May 21, 2015 at 03:51:43PM +0200, Paolo Bonzini wrote:
> > Some of you may have heard about the "Clear Containers" initiative from
> > Intel, which couple KVM with various kernel tricks to create extremely
> > lightweight virtual machines.  The experimental Clear Containers setup
> > requires only 18-20 MB to launch a virtual machine, and needs about 60
> > ms to boot.
> > 
> > Now, as all of you probably know, "QEMU is great for running Windows or
> > legacy Linux guests, but that flexibility comes at a hefty price. Not
> > only does all of the emulation consume memory, it also requires some
> > form of low-level firmware in the guest as well. All of this adds quite
> > a bit to virtual-machine startup times (500 to 700 milliseconds is not
> > unusual)".
> > 
> > Right?  In fact, it's for this reason that Clear Containers uses kvmtool
> > instead of QEMU.
> > 
> > No, wrong!  In fact, reporting bad performance is pretty much the same
> > as throwing down the gauntlet.
> > 
> > Enter qboot, a minimal x86 firmware that runs on QEMU and, together with
> > a slimmed-down QEMU configuration, boots a virtual machine in 40
> > milliseconds[2] on an Ivy Bridge Core i7 processor.
> 
> Hi Paolo,
> 
> I'm curious if you've tried profiling SeaBIOS to see where it is
> spending unnecessary time?  I wonder if a stripped down SeaBIOS could
> obtain sufficient performance.
> 
> The page at http://seabios.org/Debugging#Timing_debug_messages
> describes how to do basic profiling via timing of debug messages.
> 
> The default SeaBIOS build takes ~180ms on my (old AMD) system.  But,
> by removing drivers and options via Kconfig I was able to bring it
> down to ~25ms.  I suspect some additional Kconfig settings and a few
> optimizations would make it possible to significantly reduce this
> time.

Out of curiosity, I ran some additional timing tests.  With SeaBIOS
fully stripped down (via Kconfig), it takes ~20ms to get to the boot
phase on my old AMD system.  Of that 20ms, ~7ms is to enable shadow
ram, 2ms is to calibrate the cpu timestamp counter, 4ms is for pci
init, and ~6ms is to make the shadow ram area read-only.  The time in
the remaining parts of the SeaBIOS code is so small that it's hard to
measure.

The above delays could be removed without much work:  It would be
trivial to add kconfig options to support disabling the pci init and
shadow read-only functionality.  The cpu timestamp calibrations could
be reworked so that the existence of the ACPI timer was checked first
so as to avoid that work.  The enabling of shadow ram could also be
bypassed if QEMU was changed to start with a ram based shadow instead
of a rom shadow (since QEMU doesn't fully implement the chipset shadow
registers, it's really pointless to start in rom shadow mode anyway).

-Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]