feat(kernel): support bzImage direct boot on x86_64#6037
Draft
Manciukic wants to merge 4 commits into
Draft
Conversation
Manciukic
force-pushed
the
feat/bzimage-boot
branch
from
July 17, 2026 15:24
3258a9f to
2d6e1df
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6037 +/- ##
=======================================
Coverage 82.85% 82.86%
=======================================
Files 277 277
Lines 30633 30651 +18
=======================================
+ Hits 25381 25398 +17
- Misses 5252 5253 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Manciukic
force-pushed
the
feat/bzimage-boot
branch
2 times, most recently
from
July 17, 2026 18:15
9288234 to
a20bfa1
Compare
Previously only uncompressed ELF (vmlinux) kernels could boot on x86_64. load_kernel now falls back to the linux-loader bzImage loader when the image is not a valid ELF (InvalidElfMagicNumber). A bzImage boots via the Linux 64-bit boot protocol at code32_start + 0x200, using the same guest CPU state as the ELF LinuxBoot path. The only extra step is seeding the zero page with the image's own setup header, so EntryPoint now carries that header (x86_64 only) for configure_64bit_boot to merge into boot_params. Enable the linux-loader "bzimage" feature. Unit tests cover bzImage selection, ELF carrying no setup header, and rejecting invalid images. Signed-off-by: Riccardo Mancini <mancio@amazon.com>
Add an x86_64-only functional test, test_bzimage_boots_to_userspace, that boots the bzImage sibling of the default guest vmlinux, confirms the guest reaches userspace over SSH, and asserts (via the Debug log) that Firecracker took the bzImage load path. Signed-off-by: Riccardo Mancini <mancio@amazon.com>
Note under Unreleased that x86_64 now supports booting bzImage guest kernels in addition to uncompressed ELF vmlinux images. Signed-off-by: Riccardo Mancini <mancio@amazon.com>
Update the kernel image format statement and manual build steps to reflect that x86_64 now supports bzImage kernels in addition to uncompressed ELF, and note the boot time and memory trade-off. Signed-off-by: Riccardo Mancini <mancio@amazon.com>
Manciukic
force-pushed
the
feat/bzimage-boot
branch
from
July 17, 2026 18:55
a20bfa1 to
eac4739
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Add support for booting
bzImageguest kernels on x86_64, in addition to theexisting uncompressed ELF (
vmlinux) images.load_kernelnow attempts the ELF loader first and, when the image is not avalid ELF binary, falls back to the
linux-loaderbzImage loader. AbzImageis entered through its 64-bit entry point (
code32_start + 0x200) using theLinux 64-bit boot protocol — the same guest CPU state already used for ELF
LinuxBootkernels — with the one extra step of seeding the zero page from theimage's own setup header. The kernel image format is detected automatically, so
no API or configuration change is required.
Includes unit tests (loader selection, setup-header handling, invalid-image
rejection) and a functional test suite that boots real
bzImageartifacts touserspace and checks them against the equivalent
vmlinux.This builds on #6035, which added the
bzImageCI artifact build.Reason
bzImageis the format many kernel build pipelines produce by default, sosupporting it directly avoids requiring users to extract a
vmlinux. Note thatbzImageis provided for compatibility;vmlinuxremains recommended, as thein-guest self-decompression costs extra boot time and memory (documented in
docs/rootfs-and-kernel-setup.md).License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.