Skip to content

Commit

Permalink
igvm_params: Replace launch_fw with firmware range in IGVM parameter …
Browse files Browse the repository at this point in the history
…block

The IgvmParamBlock currently contains a flag that determines whether the
guest firmware (OVMF) should be launched or not by the SVSM kernel.
However, in order to launch the firmware embedded in an IGVM file the
SVSM needs to know the GPA at which the firmware is loaded and the
number of pages in order to set the correct VMPL permissions on the
pages.

For the non-IGVM case, this comes from fw_cfg but this is not populated
when using IGVM files. So this commit replaces the launch_fw flag with a
start GPA and page range for the firmware region.

Signed-off-by: Roy Hopkins <roy.hopkins@suse.com>
  • Loading branch information
roy-hopkins committed Dec 13, 2023
1 parent 7fba100 commit 05d5131
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions igvm_params/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ pub struct IgvmParamBlock {
/// The guest physical address of the secrets page.
pub secrets_page: u32,

/// A flag indicating whether the kernel should proceed with the flow
/// to launch guest firmware once kernel initialization is complete.
pub launch_fw: u8,
/// The guest physical address of the start of the guest firmware. The
/// permissions on the pages in the firmware range are adjusted to the guest
/// VMPL. If this field is zero then no firmware is launched after
/// initialization is complete.
pub fw_start: u32,

_reserved: [u8; 3],
/// The number of pages of guest firmware. If the firmware size is zero then
/// no firmware is launched after initialization is complete.
pub fw_size: u32,

/// The amount of space that must be reserved at the base of the kernel
/// memory region (e.g. for VMSA contents).
Expand Down
2 changes: 1 addition & 1 deletion src/igvm_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ impl IgvmParams<'_> {
}

pub fn should_launch_fw(&self) -> bool {
self.igvm_param_block.launch_fw != 0
self.igvm_param_block.fw_size != 0
}
}

0 comments on commit 05d5131

Please sign in to comment.