Skip to content

Commit

Permalink
firmware/snp: Update PlatformStatus bitflag fields
Browse files Browse the repository at this point in the history
Initially, byte 0x3 of STRUCT_PLATFORM_STATUS only used bit 0 to
indicate if the RMP was initialized. Updates were made to include
bitfields to indicate if alias detection has completed since the
last system reset and there are no aliasing addresses (bit 1), as well
as if SEV-TIO is enabled (bit 3).

Signed-off-by: Tyler Fanelli <[email protected]>
  • Loading branch information
tylerfanelli committed Dec 20, 2024
1 parent 18ed5c5 commit 1454cec
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/firmware/host/types/snp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,24 @@ pub struct Build {
pub build: u32,
}

bitflags::bitflags! {
/// Various platform initialization configuration data. Byte 0x3 in SEV-SNP's
/// STRUCT_PLATFORM_STATUS.
#[derive(Default)]
pub struct PlatformInit: u8 {
/// Indicates if RMP is initialized.
const IS_RMP_INIT = 1 << 0;
/// Indicates that alias detection has completed since the last system reset
/// and there are no aliasing addresses. Resets to 0.
/// Added in firmware version:
/// Milan family: 1.55.22
/// Genoa family: 1.55.38
const ALIAS_CHECK_COMPLETE = 1 << 1;
/// Indicates TIO is enabled. Present if SevTio feature bit is set.
const IS_TIO_EN = 1 << 3;
}
}

/// Query the SEV-SNP platform status.
///
/// (Chapter 8.3; Table 38)
Expand All @@ -238,7 +256,7 @@ pub struct SnpPlatformStatus {
pub state: u8,

/// IsRmpInitiailzied
pub is_rmp_init: u8,
pub is_rmp_init: PlatformInit,

/// The platform build ID.
pub build_id: u32,
Expand Down

0 comments on commit 1454cec

Please sign in to comment.