Skip to content

Commit

Permalink
Configure guest vTOM when configured by IGVM parameters
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 18, 2023
1 parent 95c5bc5 commit ec911df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions igvm_params/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ pub struct IgvmParamBlock {

/// The guest physical address of the base of the kernel memory region.
pub kernel_base: u64,

/// The value of vTOM used by the guest, or zero if not used.
pub vtom: u64,
}

/// The IGVM context page is a measured page that is used to specify the start
Expand Down
6 changes: 6 additions & 0 deletions src/igvm_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ impl IgvmParams<'_> {
vmsa.es = vmsa.ds;
vmsa.fs = vmsa.ds;
vmsa.gs = vmsa.ds;

// Configure vTOM if reqqested.
if self.igvm_param_block.vtom != 0 {
vmsa.vtom = self.igvm_param_block.vtom;
vmsa.sev_features |= 2; // VTOM feature
}
}
}
}

0 comments on commit ec911df

Please sign in to comment.