Skip to content

Commit

Permalink
platform/tdp: Error on !VTOM
Browse files Browse the repository at this point in the history
VTOM shall never be 0 on TDP platforms. Return an error if this is the
case.

Signed-off-by: Peter Fang <[email protected]>
  • Loading branch information
peterfang committed Nov 14, 2024
1 parent dfaf7f0 commit bf1e886
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/src/platform/tdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ impl SvsmPlatform for TdpPlatform {
}

fn env_setup(&mut self, debug_serial_port: u16, vtom: usize) -> Result<(), SvsmError> {
if vtom == 0 {
return Err(SvsmError::PlatformInit);
}
VTOM.init(&vtom).map_err(|_| SvsmError::PlatformInit)?;
// Serial console device can be initialized immediately
init_svsm_console(&GHCI_IO_DRIVER, debug_serial_port)
Expand Down

0 comments on commit bf1e886

Please sign in to comment.