-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement an EFI flavor #161
Merged
Merged
Conversation
This file contains 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
Use our wrapper for EFD_NONBLOCK instead of the one in libc for compatiblity with macOS. Signed-off-by: Sergio Lopez <slp@redhat.com>
Use a build-time conditional to import the right MetadataExt for current the target OS. Signed-off-by: Sergio Lopez <slp@redhat.com>
Up to this point virtio-blk was gated behind the "tee" feature. Since we now will be wanting to enable it too for the future "efi" flavor (and perhaps even for the regular one), move it behind its own feature. Signed-off-by: Sergio Lopez <slp@redhat.com>
We were generating a non-page-aligned size that was confusing EDK2. Signed-off-by: Sergio Lopez <slp@redhat.com>
We were using "arm,gic-400" which Linux understood but confuses EDK2. Use "arm,cortex-a15-gic" instead. Signed-off-by: Sergio Lopez <slp@redhat.com>
Add a prebuilt EDK2 binary to be bundled and used as firmware with the "efi" flavor of the library. Signed-off-by: Sergio Lopez <slp@redhat.com>
The "efi" feature will enable us to produce an EFI flavor the library, that will be targeted towards running full VMs using EDK2 as firmware. This was we sacrifice the ultra-fast boot time of the regular flavor in favor of being able to boot regular disk images, with their own kernel and initrd, as long they have an EFI layout. This commit introduces just lays the foundations for this feature. Don't expect EDK2 to boot properly just from this commit. Signed-off-by: Sergio Lopez <slp@redhat.com>
The legacy serial port is useful for debugging and pretty much compulsory for booting EDK2. Enable an output-only serial port for the "efi" feature. Signed-off-by: Sergio Lopez <slp@redhat.com>
The EDK2 build for QEMU always expects to find the FDT at the start of DRAM. Do the same thing for simplicity. Signed-off-by: Sergio Lopez <slp@redhat.com>
slp
force-pushed
the
efi-flavor
branch
4 times, most recently
from
February 7, 2024 15:34
db81c28
to
b8b6c3d
Compare
Relax queue restrictions to allow EDK2 to operate them properly. Signed-off-by: Sergio Lopez <slp@redhat.com>
On PORT_READY, EDK2 expects the console port to be open in addition be marked as console, so do it accordingly. Signed-off-by: Sergio Lopez <slp@redhat.com>
Simplify reset method to just return a boolean to indicate whether the reset was successful or not. Signed-off-by: Sergio Lopez <slp@redhat.com>
Implement reset method by just returning "true" without doing anything. Strictly speaking it's not enough, but we don't support any scenario where more work is actually required. Signed-off-by: Sergio Lopez <slp@redhat.com>
Implement reset method by just returning "true" without doing anything. Strictly speaking it's not enough, but we don't support any scenario where more work is actually required. Signed-off-by: Sergio Lopez <slp@redhat.com>
Implement reset method by shutting down all ports and stopping their respective threads. This required extending the functionality a bit to ensure we can issue an ordered shut down of each spawned thread. Signed-off-by: Sergio Lopez <slp@redhat.com>
The efi flavor doesn't need a bundled kernel, so allow it to be built without linking against libkrunfw. Signed-off-by: Sergio Lopez <slp@redhat.com>
In the efi flavor the guest will spawn its own init instead of ours, so don't bundle it. Signed-off-by: Sergio Lopez <slp@redhat.com>
Introduce the EFI variable to trigger building the efi flavor of the library this way: make EFI=1 Signed-off-by: Sergio Lopez <slp@redhat.com>
Add "boot_efi.c", an example of using libkrun to boot a guest disk image using EFI. Signed-off-by: Sergio Lopez <slp@redhat.com>
Using EV_ONESHOT to simulate epoll's EDGE_TRIGGERED semantics was wrong. Let's use EV_CLEAR instead. Signed-off-by: Sergio Lopez <slp@redhat.com>
Propagate interrupt controller into the virtio-net device. Without this, virtio-net can't send interrupts in macOS/hvf. Signed-off-by: Sergio Lopez <slp@redhat.com>
Extend the workflow for the darwin target to run clippy checks on the EFI feature. Signed-off-by: Sergio Lopez <slp@redhat.com>
Avoid unnecesary cast to please clippy. Signed-off-by: Sergio Lopez <slp@redhat.com>
AsRawFd is only used on Linux, gate it behind a build-time conditional. Signed-off-by: Sergio Lopez <slp@redhat.com>
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.
This (draft) PR adds a new feature, "efi", that will be used to produce a new flavor (
libkrun-efi.so
) of the library (in the same way we havelibkrun.so
andlibkrun-sev.so
now).Initially, only aarch64 will be supported, as the initial goal is to be able to act as an open replacement for Virtualization.framework for Apple Silicon devices running macOS.