feat: add a way to boot UEFI with -kernel and -initrd QEMU args#615
Open
zyuiop wants to merge 4 commits into
Open
feat: add a way to boot UEFI with -kernel and -initrd QEMU args#615zyuiop wants to merge 4 commits into
-kernel and -initrd QEMU args#615zyuiop wants to merge 4 commits into
Conversation
67109f8 to
9098036
Compare
Contributor
Author
|
Re. the funky build script: I was planning to use linker scripts for that initially, but it seems we cannot add a linker script with In any case I don't know how to write linker scripts so this is probably the easiest way. We can potentially split the PR in two, one with the rust code changes, and one with the README + funky script. |
9098036 to
c76dcaf
Compare
c76dcaf to
22dd6a2
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.
In order for a
-kernelargument to be valid for UEFI boot with AMD SEV-SNP, it needs to "look" like a Linux Kernel, and specifically bits at positions 0x202 must be set to the LinuxBoot magic value, with version at least 0x202.This requires "patching" the image, for which I provide an additional step in the xtask build scripts.
In addition, I modify the
uefientrypoint to parse OVMF provided command line arguments, which include theinitrd=path for the-initrdarguments, as well as any provided-appendarguments, and use those instead of the defaulthermit-appandhermit-argsfiles.This is particularly useful for AMD SEV-SNP because it allows us to use "Measured Direct Boot" (a feature of QEMU which takes the
kernel/initrd/appendarguments and puts their hashes directly in OVMF, ensuring they are verified before boot, and therefore guaranteeing integrity of the files) with Hermit, without relying on Secure Boot (which we were doing up until now in a non-published patch)