-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend TdInfo struct to add vcpu_index field #713
Conversation
tdx-tdcall/src/tdx.rs
Outdated
@@ -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], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add u32, we need reduce u32 from rsvd. For example,
pub rsvd1: u32,
pub rsvd: [u64; 2],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, since pub vcpu_index: u32
was added, to maintain the same struct size, pub rsvd: [u64; 3]
was modified to pub rsvd: [u32; 5]
.
tdx-tdcall/src/tdx.rs
Outdated
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change this.
Signed-off-by: OuyangHang33 <hank.ouyang@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, change LGTM!
Fix: #708
add vcpu_index field