Skip to content

Commit

Permalink
Extend TdInfo struct to add vcpu_index field
Browse files Browse the repository at this point in the history
Signed-off-by: OuyangHang33 <[email protected]>
  • Loading branch information
OuyangHang33 committed Jun 17, 2024
1 parent ac333c7 commit 651c180
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tdx-tdcall/src/tdx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub struct TdInfo {
pub attributes: u64,
pub max_vcpus: u32,
pub num_vcpus: u32,
pub vcpu_index: u32,
pub rsvd: [u64; 3],
}

Expand Down Expand Up @@ -504,6 +505,7 @@ pub fn tdcall_get_td_info() -> Result<TdInfo, TdCallError> {
attributes: args.rdx,
max_vcpus: (args.r8 >> 32) as u32,
num_vcpus: args.r8 as u32,
vcpu_index: args.r9 as u32,
..Default::default()
};

Expand Down Expand Up @@ -700,7 +702,7 @@ mod tests {
fn test_struct_size_alignment() {
assert_eq!(align_of::<TdxDigest>(), 64);
assert_eq!(size_of::<TdxDigest>(), 64);
assert_eq!(size_of::<TdInfo>(), 48);
assert_eq!(size_of::<TdInfo>(), 56);
assert_eq!(size_of::<TdVeInfo>(), 48);
}

Expand Down

0 comments on commit 651c180

Please sign in to comment.