Skip to content

Commit

Permalink
platform/tdp: replace tdx-tdcall crate with local implementation
Browse files Browse the repository at this point in the history
The `tdx-tdcall` crate is built for different security and design
assumptions than what is required for COCONUT-SVSM.  The TDCALL/TDVMCALL
functionality required can be implemented locally, providing better
integration with the COCONUT-SVSM environment.

Signed-off-by: Jon Lange <[email protected]>
  • Loading branch information
msft-jlange committed Nov 14, 2024
1 parent d60a5c5 commit 45591bc
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 165 deletions.
125 changes: 8 additions & 117 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ libfuzzer-sys = "0.4"
log = "0.4.17"
p384 = { version = "0.13.0" }
sha2 = "0.10.8"
tdx-tdcall = "0.2.1"
uuid = "1.6.1"
# Add the derive feature by default because all crates use it.
zerocopy = { version = "0.8.2", features = ["alloc", "derive"] }
Expand Down
1 change: 0 additions & 1 deletion kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ igvm_defs = { workspace = true, features = ["unstable"] }
intrusive-collections.workspace = true
log = { workspace = true, features = ["max_level_info", "release_max_level_info"] }
packit.workspace = true
tdx-tdcall.workspace = true
libmstpm = { workspace = true, optional = true }
zerocopy.workspace = true

Expand Down
3 changes: 2 additions & 1 deletion kernel/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::sev::msr_protocol::GhcbMsrError;
use crate::sev::SevSnpError;
use crate::syscall::ObjError;
use crate::task::TaskError;
use crate::tdx::TdxError;
use elf::ElfError;
use syscall::SysCallError;

Expand Down Expand Up @@ -58,7 +59,7 @@ pub enum SvsmError {
/// Errors related to SEV-SNP operations, like PVALIDATE or RMPUPDATE
SevSnp(SevSnpError),
/// Errors related to TDX operations
Tdx,
Tdx(TdxError),
/// Generic errors related to memory management
Mem,
/// Errors related to the memory allocator
Expand Down
1 change: 1 addition & 0 deletions kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub mod string;
pub mod svsm_paging;
pub mod syscall;
pub mod task;
pub mod tdx;
pub mod types;
pub mod utils;
#[cfg(all(feature = "mstpm", not(test)))]
Expand Down
Loading

0 comments on commit 45591bc

Please sign in to comment.