Skip to content

Commit

Permalink
Consume the IGVM parameters during kernel launch
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Lange <jlange@microsoft.com>
  • Loading branch information
msft-jlange committed Dec 4, 2023
1 parent 92da854 commit 3df27ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/svsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use svsm::error::SvsmError;
use svsm::fs::{initialize_fs, populate_ram_fs};
use svsm::fw_cfg::FwCfg;
use svsm::greq::driver::guest_request_driver_init;
use svsm::igvm_params::IgvmParams;
use svsm::kernel_launch::KernelLaunchInfo;
use svsm::mm::alloc::{memory_info, print_memory_info, root_mem_init};
use svsm::mm::memory::init_memory_map;
Expand Down Expand Up @@ -423,7 +424,13 @@ pub extern "C" fn svsm_main() {
// a remote GDB connection
//debug_break();

let config = SvsmConfig::FirmwareConfig(FwCfg::new(&CONSOLE_IO));
let launch_info = &*LAUNCH_INFO;
let config = if launch_info.igvm_params != 0 {
let igvm_params = IgvmParams::new(VirtAddr::from(launch_info.igvm_params));
SvsmConfig::IgvmConfig(igvm_params)
} else {
SvsmConfig::FirmwareConfig(FwCfg::new(&CONSOLE_IO))
};

invalidate_stage2(&config).expect("Failed to invalidate Stage2 memory");

Expand Down

0 comments on commit 3df27ec

Please sign in to comment.