UEFI Performance Overhead in Lightweight VMs
Lightweight virtual machines (microVMs) are engineered for near-instant boot times, high density, and minimal resource footprints, making them ideal for serverless computing and multi-tenant container isolation. However, using the Unified Extensible Firmware Interface (UEFI) as a bootloader introduces substantial performance penalties that undermine these benefits. This article examines the architectural bottlenecks caused by UEFI during microVM initialization—specifically execution latency, hardware enumeration bloat, memory consumption, and cryptographic checks—while comparing it to streamlined alternatives like direct kernel booting.
Boot Time Latency
The most significant overhead imposed by UEFI is the latency added to
the initialization phase. MicroVM hypervisors such as AWS Firecracker,
Cloud Hypervisor, and QEMU (using the microvm machine type)
aim for boot times between 5 and 30 milliseconds. Standard UEFI
implementations, such as Open Virtual Machine Firmware (OVMF) derived
from TianoCore EDK II, routinely add between 100 milliseconds to several
seconds to the initialization sequence. For ephemeral workloads like
serverless functions, where instances are spawned on demand, this
firmware execution phase can represent over 90% of the total VM startup
time.
Unnecessary Hardware Discovery and Driver Dispatch
UEFI was designed for general-purpose physical machines with diverse and unpredictable hardware. Consequently, its initialization process passes through several distinct phases: Security (SEC), Pre-EFI Initialization (PEI), and the Driver Execution Environment (DXE).
During these phases, the firmware performs the following non-essential operations for a lightweight VM:
- Bus Enumeration: It probes virtual PCI/PCIe hierarchies, USB buses, and generic peripheral interfaces, even when the guest hypervisor provides a static, fully known, minimal set of virtio devices.
- Driver Dispatching: The DXE dispatcher loads dozens of modular device drivers to initialize storage, console, and network controllers sequentially.
- ACPI Table Generation: UEFI frequently recreates or parses complex ACPI tables in memory, duplicating work that modern virtualization tools can inject directly into guest memory before CPU execution begins.
Memory Overhead and Footprint Bloat
UEFI increases the guest memory footprint before the operating system kernel even starts. An OVMF binary typically ranges from 2 MB to 4 MB in size and must be mapped into the guest address space. During initialization, UEFI allocates page tables, establishes runtime services, and reserves memory regions that remain occupied throughout the VM’s lifecycle. In high-density environments where thousands of microVMs reside on a single physical host, reserving megabytes of RAM per guest purely for firmware structures wastes substantial physical memory.
Cryptographic and Verification Delays
When UEFI Secure Boot is enabled, the firmware must validate cryptographic signatures on the OS bootloader and kernel against certificates stored in virtual non-volatile variables (NVRAM). Parsing signature databases (db/dbx) and running hashing algorithms like SHA-256 inside an unoptimized firmware environment introduces additional CPU cycles. While critical for untrusted bare-metal machines, this validation is often redundant in microVM environments where the hypervisor itself cryptographically verifies the guest kernel before launch.
Bypassing UEFI: Direct Kernel Boot
To eliminate UEFI overhead, lightweight virtualization stacks predominantly use Direct Kernel Boot mechanisms. By utilizing protocols such as the x86 Linux Boot Protocol or the PVH (Paravirtualized Hardware) boot standard, the hypervisor writes the kernel, initramfs, and kernel command-line arguments directly into guest memory and sets the virtual CPU registers to jump straight into the kernel entry point.
Bypassing UEFI entirely removes the SEC, PEI, and DXE execution cycles, reduces the required guest memory footprint, and allows microVMs to complete guest initialization in single-digit milliseconds.