#guest #intel #tdx #instructions #api #domain #trust

tdx-guest

The tdx-guest provides a Rust implementation of Intel® Trust Domain Extensions (Intel® TDX) Guest APIs, supporting for TDX Guest specific instructions, structures and functions

9 releases

new 0.1.8 Dec 9, 2024
0.1.7 Jul 16, 2024
0.1.5 Jun 27, 2024
0.1.1 May 22, 2024
0.1.0 Apr 28, 2024

#698 in Data structures

Download history 1010/week @ 2024-08-18 1067/week @ 2024-08-25 911/week @ 2024-09-01 1106/week @ 2024-09-08 1046/week @ 2024-09-15 2374/week @ 2024-09-22 2004/week @ 2024-09-29 1276/week @ 2024-10-06 1877/week @ 2024-10-13 2159/week @ 2024-10-20 2204/week @ 2024-10-27 2042/week @ 2024-11-03 1954/week @ 2024-11-10 1778/week @ 2024-11-17 1242/week @ 2024-11-24 1397/week @ 2024-12-01

6,700 downloads per month
Used in ostd

BSD-3-Clause

81KB
1.5K SLoC

OpenSSF Best Practices

Introducing tdx-guest

The tdx-guest provides a Rust implementation of Intel® Trust Domain Extensions (Intel® TDX) Guest APIs, supporting for TDX Guest specific instructions, structures and functions.

TDCALL Implementation

Leaf Num Name in Specification Description Is Implemented Interface Function Name TDX version
0 TDG.VP.VMCALL Call a host VM service Please refer TDVMCALL Implementment 1.0, 1.5
1 TDG.VP.INFO Get TD execution environment information get_tdinfo 1.0, 1.5
2 TDG.MR.RTMR.EXTEND Extend a TD run-time measurement register extend_rtmr 1.0, 1.5
3 TDG.VP.VEINFO.GET Get Virtualization Exception Information for the recent #VE exception get_veinfo 1.0, 1.5
4 TDG.MR.REPORT Creates a cryptographic report of the TD get_report 1.0, 1.5
5 TDG.VP.CPUIDVE.SET Control delivery of #VE on CPUID instruction execution set_cpuidve 1.0, 1.5
6 TDG.MEM.PAGE.ACCEPT Accept a pending private page into the TD accept_page 1.0, 1.5
7 TDG.VM.RD Read a TD-scope metadata field read_td_metadata 1.0, 1.5
8 TDG.VM.WR Write a TD-scope metadata field write_td_metadata 1.0, 1.5
9 TDG.VP.RD Read a VCPU-scope metadata field - 1.5
10 TDG.VP.WR Write a VCPU-scope metadata field - 1.5
11 TDG.SYS.RD Read a TDX Module global-scope metadata field - 1.5
12 TDG.SYS.RDALL Read all gust-readable TDX Module global-scope metadata fields - 1.5
18 TDG.SERVTD.RD Read a target TD metadata field read_servetd 1.5
20 TDG.SERVTD.WR Write a target TD metadata field write_servetd 1.5
22 TDG.MR.VERIFYREPORT Verify a cryptographic report of a TD, generated on the current platform verify_report 1.5
23 TDG.MEM.PAGE.ATTR.RD Read the GPA mapping and attributes of a TD private page read_page_attr 1.5
24 TDG.MEM.PAGE.ATTR.WR Write the attributes of a private page write_page_attr 1.5
25 TDG.VP.ENTER Enter L2 VCPU operation enter_l2_vcpu 1.5
26 TDG.VP.INVEPT Invalidate cached EPT translations for selected L2 VMs invalidate_l2_cached_ept 1.5
27 TDG.VP.INVGLA Invalidate cached translations for selected pages in an L2 VM invalidate_l2_gla 1.5

TDVMCALL Implementation

Sub-Function Number Sub-Function Name in Specification Is Implemented Interface Function Name TDX version
0x10000 GetTdVmCallInfo get_tdvmcall_info 1.0, 1.5
0x10001 MapGPA map_gpa 1.0, 1.5
0x10002 GetQuote get_quote 1.0, 1.5
0x10003 ReportFatalError - 1.0, 1.5
0x10004 SetupEventNotifyInterrupt setup_event_notify_interrupt 1.0, 1.5
0x10005 Service get_td_service 1.5
Sub-Function Number Bits 15:0 Sub-Function Name in Specification Is Implemented Interface Function Name TDX version
10 Instruction.CPUID cpuid 1.0, 1.5
12 Instruction.HLT hlt 1.0, 1.5
30 Instruction.IO io_read, io_write 1.0, 1.5
31 Instruction.RDMSR rdmsr 1.0, 1.5
32 Instruction.WRMSR wrmsr 1.0, 1.5
48 #VE.RequestMMIO read_mmio, write_mmio 1.0, 1.5
54 Instruction.WBINVD perform_cache_operation 1.0, 1.5
65 Instruction.PCONFIG - 1.0, 1.5

Dependencies

~15MB
~316K SLoC