STRUCT SGX_TCS(9)
β¨ NAME β¨
okay so weβre in the Kernel API Manual, and this page is struct sgx_tcs(9) β aka Thread Control Structure (TCS) π. Itβs giving βenclave entry-point documentation but make it cute,β and we are keeping every single deet, no cap.
πΈ SYNOPSIS πΈ
struct sgx_tcs {
u64 state;
u64 flags;
u64 ssa_offset;
u32 ssa_index;
u32 nr_ssa_frames;
u64 entry_offset;
u64 exit_addr;
u64 fs_offset;
u64 gs_offset;
u32 fs_limit;
u32 gs_limit;
u8 reserved[SGX_TCS_RESERVED_SIZE];
};
slay, thatβs the whole struct β no missing fields, fr fr π§.
π Members π
stateβ used to mark an entered TCS.flagsβ execution flags, and they are cleared by EADD. EADD said βnot today,β periodt. πssa_offsetβ SSA stack offset relative to the enclave base.ssa_indexβ the current SSA frame index. The source spells itcleard by EADDπ, meaning itβs cleared by EADD β typo deets preserved, bestie.nr_ssa_framesβ the number of frame in the SSA stack. (Original wording saysframe, singular π«Ά.)entry_offsetβ entry point offset relative to the enclave base.exit_addrβ address outside the enclave to exit on an exception or interrupt.fs_offsetβ offset relative to the enclave base to become FS segment inside the enclave.gs_offsetβ offset relative to the enclave base to become GS segment inside the enclave.fs_limitβ size to become a new FS-limit (only 32-bit enclaves).gs_limitβ size to become a new GS-limit (only 32-bit enclaves).
π¦ Description π¦
Thread Control Structure (TCS) is an enclave page visible in its address space that defines an entry point inside the enclave. A thread enters inside an enclave by supplying address of TCS to ENCLU(EENTER). A TCS can be entered by only one thread at a time β thatβs the whole vibe check π₯.
π SEE ALSO π
Kernel file ./arch/x86/include/asm/sgx.h β and hereβs the full squad, bestie:
SGX_ENCLS_FAULT_FLAG(9)enum sgx_return_code(9)enum sgx_miscselect(9)enum sgx_attribute(9)struct sgx_secs(9)enum sgx_tcs_flags(9)struct sgx_pageinfo(9)enum sgx_page_type(9)enum sgx_secinfo_flags(9)struct sgx_secinfo(9)struct sgx_pcmd(9)struct sgx_sigstruct_header(9)struct sgx_sigstruct_body(9)struct sgx_sigstruct(9)
okay bye bestie π«Ά struct sgx_tcs(9) is out π
β source/version: ./arch/x86/include/asm, dated October 2026. Iconic. Done. Periodt. π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms