qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin O'Connor <kevin@koconnor.net>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>, KVM list <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU
Date: Fri, 22 May 2015 23:55:01 -0400	[thread overview]
Message-ID: <20150523035501.GA20419@morn.localdomain> (raw)
In-Reply-To: <20150522232327.GA23114@morn.localdomain>

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	other threads:[~2015-05-23  3:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 13:51 [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU Paolo Bonzini
2015-05-21 15:48 ` Avi Kivity
2015-05-21 16:21   ` Paolo Bonzini
2015-05-21 18:28     ` Avi Kivity
2015-05-21 17:04 ` Jan Kiszka
2015-05-22  2:53 ` Yong Wang
2015-05-26  8:47   ` Stefan Hajnoczi
2015-06-05 10:42     ` Stefan Hajnoczi
2015-05-22 11:01 ` Daniel P. Berrange
2015-05-22 11:04   ` Peter Maydell
2015-05-22 11:12     ` Daniel P. Berrange
2015-05-22 11:21       ` Peter Maydell
2015-05-22 11:33         ` Daniel P. Berrange
2015-05-22 11:34         ` Gerd Hoffmann
2015-05-22 11:42         ` Markus Armbruster
2015-05-25 12:53       ` Paolo Bonzini
2015-05-26 21:25         ` Christopher Covington
2015-05-27  9:30           ` Paolo Bonzini
2015-05-27  9:36             ` Avi Kivity
2015-05-27 11:00               ` Paolo Bonzini
2015-05-27 11:54             ` Peter Maydell
2015-05-27 12:05               ` Paolo Bonzini
2015-05-27 12:50             ` Christopher Covington
2015-05-27 12:59               ` Paolo Bonzini
2015-05-27 16:24             ` Dr. David Alan Gilbert
2015-05-22 14:06 ` Gerd Hoffmann
2015-05-22 23:23 ` Kevin O'Connor
2015-05-23  3:55   ` Kevin O'Connor [this message]
2015-05-25  6:21     ` Vasiliy Tolstov
2015-05-25 15:05       ` Kevin O'Connor
2015-05-25 12:52   ` Paolo Bonzini
2015-05-25 15:11     ` Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150523035501.GA20419@morn.localdomain \
    --to=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).