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

Split tdx feature into tdcall and tdvmcall features as tdvmcall usage may be optional for some use cases #768

Conversation

sgrams
Copy link
Contributor

@sgrams sgrams commented Mar 7, 2025

No functional changes to existing build.
Now:

  • tdx-tdcall/src/tdx.rs is split into two files: tdx-tdcall/src/tdcall.rs and tdx-tdcall/src/tdvmcall.rs.
  • tdx-tdcall: tdx feature is split into tdcall and tdvmcall
  • all dependent libraries start using tdcall and tdvmcall features instead of tdx feature
  • td-shim/Cargo.toml and td-payload/Cargo.toml still provide tdx feature for backward compatibility, and it does include both tdcall and tdvmcall features.

sgrams added 29 commits March 3, 2025 17:44
No functional changes

Signed-off-by: Stanislaw Grams <[email protected]>
Signed-off-by: Stanislaw Grams <[email protected]>
Signed-off-by: Stanislaw Grams <[email protected]>
Signed-off-by: Stanislaw Grams <[email protected]>
Now tdx feature is removed and replaced by two separate features:
tdcall and tdvmcall. Only tdcall is enabled by default.

Signed-off-by: Stanislaw Grams <[email protected]>
Signed-off-by: Stanislaw Grams <[email protected]>
Signed-off-by: Stanislaw Grams <[email protected]>
@sgrams sgrams force-pushed the user/sgrams/25ww10e-td_shim_separate_tdx_feature branch from 4c065d0 to 15c85e2 Compare March 7, 2025 10:18
@sgrams sgrams marked this pull request as ready for review March 7, 2025 10:37
@sgrams sgrams changed the title Split tdx feature originated from tdx-tdcall into two features: tdcall and tdvmcall as tdvmcall usage may be optional for some use cases Split tdx-tdcall/tdx into tdcall and tdvmcall as tdvmcall usage may be optional for some use cases Mar 7, 2025
@sgrams sgrams changed the title Split tdx-tdcall/tdx into tdcall and tdvmcall as tdvmcall usage may be optional for some use cases Split tdx feature into tdcall and tdvmcall as tdvmcall usage may be optional for some use cases Mar 7, 2025
@sgrams sgrams changed the title Split tdx feature into tdcall and tdvmcall as tdvmcall usage may be optional for some use cases Split tdx feature into tdcall and tdvmcall features as tdvmcall usage may be optional for some use cases Mar 7, 2025
@jyao1
Copy link
Member

jyao1 commented Mar 9, 2025

I am worried on the compatibility, since there is code change. For example:

-        1 => tdx::tdvmcall_io_read_8(port) as u32,
-        2 => tdx::tdvmcall_io_read_16(port) as u32,
-        4 => tdx::tdvmcall_io_read_32(port),
+        1 => tdvmcall::io_read_8(port) as u32,
+        2 => tdvmcall::io_read_16(port) as u32,
+        4 => tdvmcall::io_read_32(port),

How do you guarantee the consumer is NOT impacted?

Also, please describe the purpose of this change, not just what the patch does.

@sgrams
Copy link
Contributor Author

sgrams commented Mar 10, 2025

This change is to allow consumers of TD-Shim to build it without support for TDVMCALLs.
We require this change in TEE-IO Provision Agent (TPA TD).

With this approach consumer must adapt, and a code change is required.
tdx::tdcall_* usage must be renamed to tdcall::*
tdx::tdvmcall_* usage must be renamed to tdvmcall::*
Imports are also affected.

@jyao1
Copy link
Member

jyao1 commented Mar 10, 2025

That introduces too many changes.

I think an easy way can be: just add [no-tdvmcall] to meet the need.

@sgrams
Copy link
Contributor Author

sgrams commented Mar 10, 2025

I'll prepare a change with no-tdvmcall feature.

@sgrams sgrams closed this Mar 10, 2025
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