Skip to content

Bundle qboot for x86-64 - #13

Merged
jacob-carlborg merged 1 commit into
masterfrom
claude/netbsd-11-microvm-kernel-wsrfrg
Aug 13, 2026
Merged

jacob-carlborg merged 1 commit into
masterfrom
claude/netbsd-11-microvm-kernel-wsrfrg

Conversation

@jacob-carlborg

@jacob-carlborg jacob-carlborg commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Adds qboot.rom from QEMU's pc-bios to the qemu-system-x86_64 tarball, so a
guest can be booted on QEMU's microvm machine type: no boot loader, no PCI bus
and no ACPI, which is worth a few seconds of every job's startup.

-kernel reads like a way around the firmware and isn't one. QEMU stages the
kernel and publishes where it starts, but something running in the guest still
has to jump there, and on microvm that is qboot. qboot is also what leaves an
MP table behind, which is the only place a guest configured without ACPI can
read the machine's CPUs and interrupt routing from -- NetBSD 11's MICROVM
kernel, the first consumer, is configured exactly that way. Handed
bios-256k.bin instead, such a guest never starts and says nothing at all
about why.

It is prebuilt in QEMU's own pc-bios directory, so it is copied from the same
tree the binary is built from and cannot disagree with it. The qboot version
does matter: the smolBSD project carries its own copy specifically to work
around qboot smashing its stack in QEMU 9.0 and 9.1.

Measured

Booting NetBSD 11.0 x86-64 on microvm with this firmware, against the same
image booted the way it is today (firmware, boot loader, PCI):

firmware microvm + qboot
QEMU start to a logged-in shell 7.05 s 3.45 s
kernel boot time -- 507 ms

Disk over virtio-mmio, network over virtio-mmio, vioif0 configured and
routing, and an SSH login: all confirmed on a freshly built image.

Not included: pvh.bin

QEMU also ships pvh.bin, the option rom that performs the PVH handover on the
machine types whose firmware can't do it themselves — it is what makes
-kernel with a PVH ELF work on q35, for instance. It is deliberately left
out. It is not needed on microvm, where qboot does the handover, and while
QEMU otherwise probes for it and logs rom: file pvh.bin: error Failed to open file on every boot when it is absent, that probe does not happen when option
roms are disabled — which is what the consumer passes
(microvm,…,x-option-roms=off). Verified against this QEMU build both ways.

Tests

test.rb asserts the exact set of files in each tarball, so the new name is
added there.

Consumer

cross-platform-actions/action decides whether it can take the fast path by
looking for share/qemu/qboot.rom next to the kernel its image bundle carries;
with either file missing it boots the way it does today. So this can land and be
released on its own, and nothing changes for anyone until the action's pinned
resources version is bumped.

qboot is the firmware for QEMU's `microvm` machine type, which a guest can be
booted on with no boot loader, no PCI bus and no ACPI. That is worth a few
seconds of every job's startup, and it needs a firmware this tarball doesn't
carry.

`-kernel` reads like a way around the firmware and isn't one: QEMU stages the
kernel and publishes where it starts, but something running in the guest still
has to jump there, and on this machine type that is qboot. qboot is also what
leaves an MP table behind, which is the only place a guest configured without
ACPI can read the machine's CPUs and interrupt routing from -- NetBSD 11's
MICROVM kernel, the first consumer, is configured exactly that way. Handed
bios-256k.bin instead, it never starts and says nothing about why.

It is prebuilt in QEMU's own pc-bios directory, so it is copied from the same
tree the binary is built from and can't disagree with it.
@jacob-carlborg
jacob-carlborg force-pushed the claude/netbsd-11-microvm-kernel-wsrfrg branch from e47908e to 7c879f4 Compare August 13, 2026 18:19
@jacob-carlborg jacob-carlborg changed the title Bundle qboot and the PVH option rom for x86-64 Bundle qboot for x86-64 Aug 13, 2026
@jacob-carlborg
jacob-carlborg merged commit d4dd9b9 into master Aug 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants