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.
Reason for This PR
The x86/HVM direct boot ABI is intended for use cases targeted by Firecracker, where legacy hardware and software support within the guest is not needed, and it allows booting guests directly into the uncompressed kernel binary, without the need for firmware.
The ABI is already supported by Linux and FreeBSD:
https://xenbits.xen.org/docs/unstable/misc/pvh.html
Examples of current use of the PVH boot protocol are the latest QEMU microvm machine type, and Intel Cloud Hypervisor/RustVMM. A limitation is that the PVH protocol is not available for aarch64.
The current patches are fully functional, and can coexist with current implementation that uses Linux 64-bit protocol, but the ability to use PVH to launch guests has been configured as an optional feature for this RFC.
If there is interest in adding this functionality to Firecracker, additional changes needed are to expand the integration tests, and provide a new API option to allow specifying the default boot protocol.
Description of Changes
Parse the PVH entry point address encoded in the kernel binary, and return it alongside the default entry point.
If the PVH optional feature is enabled use it as the preferred method to boot the guest. Configure the guest initial state (regs/sregs) as required by the PVH ABI.
Copy the set of boot parameters [hvm_start_info, memory map entries, (optional) initramfs module entry] required by PVH into guest memory.
rust-vmm
.This functionality is already available in RustVMM, where the linux-loader crate is capable of parsing the PVH entry point, and the rest of the changes described above must be implemented by the VMM. This PR Boot configurator: trait (and associated objects) that write boot params in guest memory rust-vmm/linux-loader#31 aims to have more of that functionality directly available on the linux-loader crate.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
PR Checklist
git commit -s
).unsafe
code is properly documented.firecracker/swagger.yaml
.CHANGELOG.md
.