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

utility.py: add TDX_CMD_GET_QUOTE_V1_5 #14

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

intelzhongjie
Copy link
Contributor

Add TDX definition for ioctl command TDX_CMD_GET_QUOTE_V1_5.
Also adjust the format of the related comments.

@intelzhongjie
Copy link
Contributor Author

intelzhongjie commented Dec 14, 2023

The definition of TDX_CMD_GET_QUOTE for TDX 1.5 is:
#define TDX_CMD_GET_QUOTE _IOR('T', 4, struct tdx_quote_req)

And the struct tdx_quote_req is defined as:


/* struct tdx_quote_req: Request struct for TDX_CMD_GET_QUOTE IOCTL.
 * @buf: Address of user buffer in the format of struct tdx_quote_buf.
 *	 Upon successful completion of IOCTL, output is copied back to
 *	 the same buffer (in struct tdx_quote_buf.data).
 * @len: Length of the Quote buffer.
 */
struct tdx_quote_req {
	__u64 buf;
	__u64 len;
};

So "sizeof(struct tdx_quote_req)" is "0b00010000".

Copy link
Member

@kenplusplus kenplusplus left a comment

Choose a reason for hiding this comment

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

I will cleanup utility.py, could we move these type of definitions to the specific class like https://github.com/cc-api/cc-trusted-api/blob/a9181eba6e5e726466f778bb34015dad3e9fd8b3/vmsdk/python/cctrusted/cvm.py#L171?

@intelzhongjie
Copy link
Contributor Author

I will cleanup utility.py, could we move these type of definitions to the specific class like

https://github.com/cc-api/cc-trusted-api/blob/a9181eba6e5e726466f778bb34015dad3e9fd8b3/vmsdk/python/cctrusted/cvm.py#L171

?

Updated as suggestions. Please review the latest version. Thanks!

Copy link
Member

@kenplusplus kenplusplus left a comment

Choose a reason for hiding this comment

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

LGTM

@kenplusplus kenplusplus merged commit c028cdc into cc-api:main Dec 14, 2023
3 checks passed
@intelzhongjie intelzhongjie deleted the ioctl branch December 21, 2023 00:07
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.

2 participants