Skip to content
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

Include SVSM module as a payload in OVMF firmware image #33

Closed
wants to merge 3 commits into from

Conversation

roy-hopkins
Copy link
Collaborator

The current svsm module needs to be loaded as a separate pflash image where QEMU detects the svsm pflash, reads the metadata and launches the module using a 32-bit entry point at offset 0 of the image. This PR introduces changes that combine the firmware images for OVMF and the svsm module as well as reorganising the entry points to simplify the configuration of the VM as well as allow removal of some boilerplate in QEMU.

The major changes introduced are:

  • Builds the EDK2 branch that supports SVSM launch of OVMF using a git submodule, integrated into the Makefile.
  • Switches to using the OvmfSvsmX64 package for OVMF which packages svsm.bin as part of the OVMF firmware image and modifies layout of reset vector and SVSM/OVMF metadata to support launch.
  • SVSM changes to use new location of OVMF metadata and to launch guest using OVMF 16-bit entry point (the original reset vector).

With these changes, it is possible to revert some of the boilerplate added to QEMU detect and launch the SVSM.

Please note that the final commit in the series switches to using the OvmfSvsmX64 package. This is currently in an active PR (coconut-svsm/edk2#1) and has not yet been merged so in order to successfully build the code for this PR you will need to checkout the relevant code from that EDK2 PR branch. Hence this PR is marked as draft until that code is merged.

scripts/build-ovmf.sh Outdated Show resolved Hide resolved
Add .vscode/settings.json that correctly configures the vscode Rust
analyzer and ignores git repositories for all submodules to improve
developer experience for people using vscode.

Signed-off-by: Roy Hopkins <rhopkins@suse.de>
COCONUT-SVSM requires a build of OVMF that supports booting via an SVSM
module. A default OVMF X64 firmware does not include this capability.
Therefore, rather than instructing the developer how to clone and
prepare a build of EDK2/OVMF, this patch adds the correct EDK2
repository and branch as a submodule and builds it as part of the SVSM
makefile.

Signed-off-by: Roy Hopkins <rhopkins@suse.de>
COCONUT-SVSM currently exclusively launches guests under OVMF. However, we
should not assume this will always be the case. With this in mind, and
also to prepare for integrating the SVSM build with OVMF the current
OVMF specific code has been refactored into a module to abstract
specific steps away from svsm.rs.

If another guest firmware is required in the future, it will be quite
simple to create a trait from the ovmf_fw/OvmfFw structure to limit any
changes required to the main SVSM module.

Signed-off-by: Roy Hopkins <rhopkins@suse.de>
@roy-hopkins
Copy link
Collaborator Author

Closing this draft PR now pending future discussions on strategies for building and packaging the SVSM and firmware. I'll retain the branch for future reference.

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