<div dir="ltr">Hi Samuel,<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 19, 2018 at 12:31 AM Samuel Ortiz <<a href="mailto:sameo@linux.intel.com" target="_blank">sameo@linux.intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Stefano,<br>
<br>
On Fri, Nov 16, 2018 at 05:13:59PM +0100, Stefano Garzarella wrote:<br>
> Hi,<br>
> I'm investigating the SeaBIOS booting time, to understand if we can reduce<br>
> the boot time in some cases (e.g. legacy hardware is not needed). I think<br>
> this<br>
> can be interesting also for NEMU developers.<br>
Definitely, thanks. </blockquote><div>You are welcome! <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
> Following this thread (<br>
> <a href="https://mail.coreboot.org/pipermail/seabios/2015-July/009497.html" rel="noreferrer" target="_blank">https://mail.coreboot.org/pipermail/seabios/2015-July/009497.html</a>),<br>
> I'm using qboot (<a href="https://github.com/bonzini/qboot" rel="noreferrer" target="_blank">https://github.com/bonzini/qboot</a>) to compare the SeaBIOS<br>
> booting time.<br>
> <br>
> As Paolo did in qboot, I manually add small debug port writes in SeaBIOS and<br>
> linuxboot_dma.c (QEMU) to trace the events with perf (kvm_pio events)<br>
When doing similar measuremnts, I also used the debug-exit qemu device<br>
in order to make imho simpler measuremnts, see<br>
<a href="https://github.com/intel/nemu/wiki/Measuring-Boot-Latency" rel="noreferrer" target="_blank">https://github.com/intel/nemu/wiki/Measuring-Boot-Latency</a><br>
<br>
Probably not as precised as yours, but it was enough for what we tried<br>
to characterize.<br>
<br>
> The goal is to have only one image of SeaBIOS configurable at runtime to<br>
> reduce<br>
> the boot time, avoiding unnecessary initialization.<br>
> <br>
> Any pointers or suggestions would be helpful.<br>
> <br>
> Following I put some preliminary measurements that I obtained:<br>
> I used this QEMU command line:<br>
> ./qemu-system-x86_64 -bios $BIOS -m 1G -cpu host -M accel=kvm \<br>
> -kernel /boot/vmlinuz-4.18.18-300.fc29.x86_64 -append 'console=ttyS0' \<br>
> -nographic -serial mon:stdio<br>
> <br>
> For each test, I measured these times (in milliseconds) relative to the<br>
> "sched_process_exec" event:<br>
> - qemu_init_end: first kvm_entry (i.e. QEMU initialized has finished)<br>
> - fw_start: first entry of the BIOS<br>
> - fw_do_boot: after the BIOS initialization (e.g. PCI setup, etc.)<br>
> - linux_start_boot: before the jump to the Linux kernel<br>
Are you planning to also measure the total time to userspace as well?<br>
How we set the hardware up from the FW/BIOS can also influence the<br>
overall (up to ring 3) boot latency on our experiments.<br></blockquote><div> </div><div>I can add another debug port write in the kernel_init (as you mentioned <br></div><div>in <a href="https://github.com/intel/nemu/wiki/Measuring-Boot-Latency" rel="noreferrer" target="_blank">https://github.com/intel/nemu/wiki/Measuring-Boot-Latency</a>)</div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> # qboot<br>
> BIOS=/home/stefano/repos/qboot/bios.bin<br>
>  qemu_init_end: 40.561234<br>
>  fw_start: 40.721729 (+0.160495)<br>
>  fw_do_boot: 47.025591 (+6.303862)<br>
>  linux_start_boot: 48.874112 (+1.848521)<br>
> <br>
> # SeaBIOS with default configuration<br>
> BIOS=/home/stefano/repos/seabios/out_default/bios.bin<br>
>  qemu_init_end: 40.419451<br>
>  fw_start: 40.639967 (+0.220516)<br>
>  fw_do_boot: 886.668828 (+846.028861)<br>
>  linux_start_boot: 889.723547 (+3.054719)<br>
> <br>
> # SeaBIOS with Kevin's configuration<br>
> # (<a href="https://mail.coreboot.org/pipermail/seabios/2015-July/009508.html" rel="noreferrer" target="_blank">https://mail.coreboot.org/pipermail/seabios/2015-July/009508.html</a>)<br>
> # Note: this SeaBIOS setup is so stripped down that it can't actually boot<br>
> an OS<br>
> BIOS=/home/stefano/repos/seabios/out_kevin/bios.bin<br>
>  qemu_init_end: 40.676412<br>
>  fw_start: 40.755757 (+0.079345)<br>
>  fw_do_boot: 56.427023 (+15.671266)<br>
That's a slight improvement ;)<br>
<br>
<br>
> I did the same tests also with NEMU (without using -M virt) and I have<br>
> approximately the same results.<br>
Yes, as expected.<br>
<br>
<br>
> As the next step, I'll start from Kevin's configuration to have a minimal<br>
> SeaBIOS image ables to boot a Linux kernel.<br>
Please keep us posted.<br></blockquote><div><br></div><div>Sure, I'll keep you updated with the progress.</div><div><br></div><div>Cheers,</div><div>Stefano<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Samuel.<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="m_8898478346271814738gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-family:monospace,monospace">Stefano Garzarella</span></div><div><span style="font-family:monospace,monospace">Red Hat</span><br></div></div></div></div>