Skip to content

Commit

Permalink
Adding correct default value for GuestFeatures
Browse files Browse the repository at this point in the history
GuestFeatures should default to 0x1 like the kernel does.

Signed-off-by: DGonzalezVillal <Diego.GonzalezVillalobos@amd.com>
  • Loading branch information
DGonzalezVillal committed Jul 31, 2024
1 parent c16705f commit ca852ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/measurement/vmsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bitfield! {
/// | 15 | SmtProtection |
/// | 63:16 | Reserved, SBZ |
#[repr(C)]
#[derive(Default, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct GuestFeatures(u64);
impl Debug;
/// SNPActive
Expand Down Expand Up @@ -174,6 +174,12 @@ bitfield! {
reserved_3, sbz: 16, 63;
}

impl Default for GuestFeatures {
fn default() -> Self {
Self(0x1)
}
}

/// SEV-ES VMSA page
/// The names of the fields are taken from struct sev_es_work_area in the linux kernel:
/// https://github.com/AMDESE/linux/blob/sev-snp-v12/arch/x86/include/asm/svm.h#L318
Expand Down

0 comments on commit ca852ea

Please sign in to comment.