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

IGVM: Add support for launching OVMF firmware when using an IGVM file for guest configuration #181

Merged
merged 4 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fw_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl<'a> FwCfg<'a> {
// This needs to be &mut self to prevent iterator invalidation, where the caller
// could do fw_cfg.select() while iterating. Having a mutable reference prevents
// other references.
pub fn iter_flash_regions(&mut self) -> impl Iterator<Item = MemoryRegion<PhysAddr>> + '_ {
pub fn iter_flash_regions(&self) -> impl Iterator<Item = MemoryRegion<PhysAddr>> + '_ {
Comment on lines 217 to +220
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change ignores the comment above the function. Not taking &mut self allows potential misbehavior. The comment should be updated or the change reverted.

let num = match self.file_selector("etc/flash") {
Ok(file) => {
self.select(file.selector);
Expand Down
2 changes: 1 addition & 1 deletion src/svsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ fn launch_fw() -> Result<(), SvsmError> {
}

fn validate_flash() -> Result<(), SvsmError> {
let mut fw_cfg = FwCfg::new(&CONSOLE_IO);
let fw_cfg = FwCfg::new(&CONSOLE_IO);

let flash_regions = fw_cfg.iter_flash_regions().collect::<Vec<_>>();
let kernel_region = LAUNCH_INFO.kernel_region();
Expand Down