[SeaBIOS] Reducing SeaBIOS kernel entry time

Marc Marí marc.mari.barcelo at gmail.com
Thu Jul 9 11:53:02 CEST 2015


On Wed, 8 Jul 2015 18:57:26 -0400
Kevin O'Connor <kevin at koconnor.net> wrote:

> On Wed, Jul 08, 2015 at 03:44:33PM +0200, Marc Marí wrote:
> > On Wed, 8 Jul 2015 09:10:14 +0100
> > Stefan Hajnoczi <stefanha at gmail.com> wrote:
> > 
> > > On Sat, Jul 4, 2015 at 6:57 PM, Kevin O'Connor
> > > <kevin at koconnor.net> wrote:
> > > > On Fri, Jul 03, 2015 at 03:12:14PM +0100, Stefan Hajnoczi wrote:
> > > >> On Fri, Jul 3, 2015 at 2:13 PM, Kevin O'Connor
> > > >> <kevin at koconnor.net> wrote:
> > > >> > I took a look a month or so ago:
> > > >> >
> > > >> > http://article.gmane.org/gmane.comp.emulators.kvm.devel/136207
> > > >> >
> > > >> > Last test I ran I had SeaBIOS down to 16ms (not including the
> > > >> > time to deploy or jump to the linux kernel).  More reductions
> > > >> > are also possible - the above was just with Kconfig settings.
> > > >> >
> > 
> > I've been measuring the time for different configurations and
> > setups.
> > 
> > The conclusion is that the main bottleneck to boot QEMU is fw_cfg.
> > 
> > Running a default SeaBIOS configuration gives these times (in
> > seconds):
> > 
> > (QEMU startup time is the time between the execution and the first
> > kvm_entry, BIOS startup time is the time between the first kvm_entry
> > and the ROM booting, and fw_cfg is the time between the ROM booting
> > and the jump to the Linux kernel).
> > 
> > QEMU startup time: .033
> > BIOS startup time: .154
> > fw_cfg setup time: .375
> > 
> > And these results are more or less the same in QBoot, when using
> > fw_cfg:
> > 
> > QEMU startup time: .026
> > BIOS startup time: .013
> > fw_cfg setup time: .373
> > 
> > The difference between SeaBIOS and QBoot is big, but, as I said,
> > this SeaBIOS is not stripped-down. Using the .config that Kevin
> > sent, I can get .01 seconds, but I cannot boot a ROM (I still have
> > to play with the configuration options until it boots). Probably it
> > can do it in less than 20 msec, which not far from QBoot.
> > 
> > On the other side, QBoot with cbfs can boot really fast:
> > 
> > QEMU startup time: .027
> > Kernel setup time: .017
> > Total time: .045
> 
> Thanks.  Can you try the latest seabios with the patch below and the
> attached config?  The patch is a complete hack, but with it you should
> be able to launch seabios with the same cbfs.rom file generated for
> qboot.  I see SeaBIOS take about 20ms on my old AMD system (again,
> further optimizations could be made with some simple code changes).  I
> used the following qemu command line:
> 
> qemu-system-x86_64 -drive
> if=pflash,file=../seabios/out/bios.bin,readonly=on -drive
> if=pflash,file=cbfs.rom,readonly=on -enable-kvm -serial mon:stdio
> 
> As a side note, if there is real interest in placing a kernel in a
> "flash" like memory mapped device, it would be nice to do something
> like the CBFS simple-elf (SELF) format so that the firmware doesn't
> have to parse the bzimage.
> 
> -Kevin
>

I tested with the given configuration and it boots. And it is faster
than QBoot.

SeaBIOS:
 - QEMU startup time: .030
 - BIOS startup time: .008
 - cbfs setup time: .0021

QBoot:
 - QEMU startup time: .030
 - BIOS startup time: .013
 - cbfs setup time: .0045

The profiling points are the same as before. "cbfs setup time" is the
time between the call to the cbfs-processing function and the jump to
the Linux kernel.

This is a great improvement on the original times.

Marc



More information about the SeaBIOS mailing list