On Thu, Nov 22, 2018 at 12:51 PM Gerd Hoffmann firstname.lastname@example.org wrote:
On Thu, Nov 22, 2018 at 12:08:55PM +0100, Stefano Garzarella wrote:
Hi, I continued to investigate how to reduce the boot time with SeaBIOS and QEMU when it used with linuxboot_dma.bin (-kernel parameter). I reached ~12ms with a SeaBIOS configuration (attached) where I disabled debug output, all Hardware support (except SMM & MTRRs) and I applied a small patch to disable VGA setup and console (attached).
Is there any difference to "qemu -vga none" ?
Using both (qemu -vga none, and my patch) we are around 10.8 ms. Note: using only the patch, Linux is still able to initialize and use the VGA.
- QEMU -vga none + SeaBIOS config (CONFIG_DEBUG_LEVEL=0, disable all HW support except SMM & MTRRs) + Stephen's TPM patch qemu_init_end: 43.675803 fw_start: 43.865178 (+0.189375) fw_do_boot: 58.093161 (+14.227983) linux_start_boot: 59.490308 (+1.397147) linux_start_user: 556.782354 (+497.292046)
- QEMU -vga none + SeaBIOS config (CONFIG_DEBUG_LEVEL=0, disable all HW support except SMM & MTRRs, CONFIG_DISABLE_VGA=y) + Stephen's TPM patch qemu_init_end: 42.387412 fw_start: 42.579257 (+0.191845) fw_do_boot: 53.381517 (+10.802260) linux_start_boot: 54.848643 (+1.467126) linux_start_user: 498.517050 (+443.668407)
Samuel, I put also the total time to userspace (linux_start_user) adding a probe in the kernel_init() and when I disabled the VGA in the SeaBIOS I noticed also a speed up in the kernel boot phase.
Might come from linux 16bit boot code scanning vgabios for available video modes (for vga=<mode> cmdline arg).
Another approach that I tried, obtaining similar results, is to recognize the linuxboot_dma.bin at runtime, then skip device_hardware_setup(), enable_vga_console(), and vgarom_setup().
Hmm, tricky. " linuxboot_dma.bin just registers a boot entry, so with "qemu -kernel -boot menu=on" you can still get a boot menu, and the direkt kernel boot is one menu item there. So you can't know for sure whenever a direct kernel boot will happen or not.
So, I think at minimum we should make this depend on both linuxboot_dma and boot menu disabled.
You are right! I'll prepare a patch adding the check of boot menu.
-- Stefano Garzarella Red Hat