Skip to content
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

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

OuyangHang33
Copy link
Collaborator

Fix: #708

add vcpu_index field

pub struct TdInfo {
    pub gpaw: u64,
    pub attributes: u64,
    pub max_vcpus: u32,
    pub num_vcpus: u32,
    pub vcpu_index: u32,
    pub rsvd: [u64; 3],
}

@@ -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],
Copy link
Member

@jyao1 jyao1 Jun 17, 2024

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],

Copy link
Contributor

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].

@@ -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);
Copy link
Member

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.

Copy link
Contributor

@vijaydhanraj vijaydhanraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, change LGTM!

@jyao1 jyao1 merged commit feea45c into confidential-containers:main Jun 18, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal to change existing TDCALL APIs to support TD Partitioning
3 participants