28 May 2024 to 1 June 2024
University of Ottawa
EST timezone

Making NetBSD as a fast(er) booting microvm

1 Jun 2024, 10:00
1h
Desmarais 1130 (University of Ottawa)

Desmarais 1130

University of Ottawa

Lecture 50 min Development Talks: Room 1130 - Saturday

Speaker

Emile Heitor (NetBSD)

Description

Last year, Colin Percival made FreeBSD a viable Firecracker guest by first enabling the kernel to boot from PVH, and then fixing and adding necessary features for it to be capable to boot and run a usable userspace.

Using his previous work in performance, he successfully booted a FreeBSD virtual machine in less than 25ms.

Taking on his work, discoveries and fixes, NetBSD is now capable of booting as a PVH guest and boot in less than 20ms.

NetBSD has been capable of booting using Qemu's -kernel flag using multiboot in i386/32 bits for quite some time, but amd64 patches never made their way to the source tree. Meanwhile, a newer and increasingly popular method in order to boot a guest without bios and bootloader appeared, a mode brought by Xen called PVH boot.

Some low level adaptations were necessary in order for the NetBSD kernel to boot using PVH, but it can now also start from Qemu without bootloader, either with a classic machine emulation or using the newer, faster microvm model.

In order to use the latter, more work was needed as both Qemu's microvm and AWS's Firecracker can use VirtIO's latest memory mapped device feature: MMIO.

Again, MMIO mode is heavily inspired by Colin's work, but NetBSD device driver handling being quite different from FreeBSD's, some extra work was needed to make it happen.

Last but not least, we will look at some modifications that were necessary in order to bring the boot time down from about 300ms to less than 20.

Primary author

Presentation materials

There are no materials yet.