arch/x86/include/asm/shared/tdx.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/shared/tdx.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/shared/tdx.h- Extension
.h- Size
- 5877 bytes
- Lines
- 193
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/types.hasm/shared/tdx_errno.hlinux/compiler_attributes.h
Detected Declarations
struct tdx_module_argsfunction _tdx_hypercallfunction hcall_func
Annotated Snippet
struct tdx_module_args {
/* callee-clobbered */
u64 rcx;
u64 rdx;
u64 r8;
u64 r9;
/* extra callee-clobbered */
u64 r10;
u64 r11;
/* callee-saved + rdi/rsi */
u64 r12;
u64 r13;
u64 r14;
u64 r15;
u64 rbx;
u64 rdi;
u64 rsi;
};
/* Used to communicate with the TDX module */
u64 __tdcall(u64 fn, struct tdx_module_args *args);
u64 __tdcall_ret(u64 fn, struct tdx_module_args *args);
u64 __tdcall_saved_ret(u64 fn, struct tdx_module_args *args);
/* Used to request services from the VMM */
u64 __tdx_hypercall(struct tdx_module_args *args);
/*
* Wrapper for standard use of __tdx_hypercall with no output aside from
* return code.
*/
static inline u64 _tdx_hypercall(u64 fn, u64 r12, u64 r13, u64 r14, u64 r15)
{
struct tdx_module_args args = {
.r10 = TDX_HYPERCALL_STANDARD,
.r11 = fn,
.r12 = r12,
.r13 = r13,
.r14 = r14,
.r15 = r15,
};
return __tdx_hypercall(&args);
}
/* Called from __tdx_hypercall() for unrecoverable failure */
void __noreturn __tdx_hypercall_failed(void);
bool tdx_accept_memory(phys_addr_t start, phys_addr_t end);
/*
* The TDG.VP.VMCALL-Instruction-execution sub-functions are defined
* independently from but are currently matched 1:1 with VMX EXIT_REASONs.
* Reusing the KVM EXIT_REASON macros makes it easier to connect the host and
* guest sides of these calls.
*/
static __always_inline u64 hcall_func(u64 exit_reason)
{
return exit_reason;
}
#endif /* !__ASSEMBLER__ */
#endif /* _ASM_X86_SHARED_TDX_H */
Annotation
- Immediate include surface: `linux/bits.h`, `linux/types.h`, `asm/shared/tdx_errno.h`, `linux/compiler_attributes.h`.
- Detected declarations: `struct tdx_module_args`, `function _tdx_hypercall`, `function hcall_func`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.