vmm: igvm: complete isolated import

Complete the isolated import, telling the
Microsoft hypervisor that import is done so that
MSHV can issue SNP_LAUNCH_FINISH command.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam 2023-12-12 16:06:25 -08:00 committed by Bo Chen
parent cbcbf635ab
commit dc68a6e30f

View File

@ -423,7 +423,7 @@ pub fn load_igvm(
{
use std::time::Instant;
let now = Instant::now();
let mut now = Instant::now();
// Sort the gpas to group them by the page type
gpas.sort_by(|a, b| a.gpa.cmp(&b.gpa));
@ -472,6 +472,21 @@ pub fn load_igvm(
now.elapsed(),
gpas.len()
);
now = Instant::now();
// Call Complete Isolated Import since we are done importing isolated pages
let host_data: [u8; 32] = [0; 32];
memory_manager
.lock()
.unwrap()
.vm
.complete_isolated_import(loaded_info.snp_id_block, host_data, 1)
.map_err(Error::CompleteIsolatedImport)?;
info!(
"Time it took to for launch complete command {:.2?}",
now.elapsed()
);
}
debug!("Dumping the contents of VMSA page: {:x?}", loaded_info.vmsa);