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@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.
Let me know if you want more info on how I did that.
That sounds interesting. Do you have a .config or git branch?
See attached SeaBIOS config. I profiled the results following the directions at:
http://www.seabios.org/Debugging#Timing_debug_messages
The QEMU command line I used is:
qemu-system-x86_64 -k en-us -snapshot -L test -chardev pipe,path=qemudebugpipe,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios -enable-kvm
To get to these low start times (~16ms on my old AMD system) I disabled debug messages in SeaBIOS. (The debug messages themselves take a few milliseconds.) So, in order to do profiling via the debug output, I manually added two small debug port writes (see seabios patch below). I end up seeing results like this on my machine:
======= Sat Jul 4 13:36:25 2015 (adjust=0.0us) 00.000: 1 00.014: 2 00.015: 2
As discussed in the thread linked to above, these numbers could be improved further by making code changes (to seabios and/or qemu). These tests were just with minimal seabios Kconfig changes.
Finally, note that this SeaBIOS setup is so stripped down that it can't actually boot an OS. The goal of the experiment was to time SeaBIOS to the point where one could add an optimized Linux deployment scheme to SeaBIOS - such as Paolo's idea of putting a kernel in a "flash" based memory mapped region. Thus, the seabios numbers above would also need to include the cost of the kernel deployment and launching, as well as the qemu startup costs, in order for them to be truly meaningful.
-Kevin
--- a/src/boot.c +++ b/src/boot.c @@ -714,6 +714,7 @@ do_boot(int seq_nr) if (seq_nr >= BEVCount) boot_fail();
+ outb('2', 0x402); outb('\n', 0x402); // Boot the given BEV type. struct bev_s *ie = &BEV[seq_nr]; switch (ie->type) { diff --git a/src/post.c b/src/post.c index 6157b50..9fd5f8f 100644 --- a/src/post.c +++ b/src/post.c @@ -329,6 +329,7 @@ handle_post(void) { if (!CONFIG_QEMU && !CONFIG_COREBOOT) return; + outb('1', 0x402); outb('\n', 0x402);
serial_debug_preinit(); debug_banner();
On Sat, Jul 4, 2015 at 6:57 PM, Kevin O'Connor kevin@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@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.
Let me know if you want more info on how I did that.
That sounds interesting. Do you have a .config or git branch?
See attached SeaBIOS config. I profiled the results following the directions at:
Thanks, we'll share the results we get.
Stefan