sgx_enclave_user_handler_t(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, this is sgx_enclave_user_handler_t(9) from the Kernel API Manual πŸ’– β€” it's the exit handler function that __vdso_sgx_enter_enclave() accepts. literally the callback for enclave exits, and it's giving main character energy ✨

πŸŽ€ SYNOPSIS πŸŽ€

int sgx_enclave_user_handler_t (long rdi , long rsi , long rdx , long rsp , long r8 , long r9 , struct sgx_enclave_run *run );

πŸ’… ARGUMENTS πŸ’…

here's the lineup, bestie:

  • rdi β€” RDI at the time of EEXIT; undefined on AEX, so don't trust it πŸ™ˆ
  • rsi β€” RSI at the time of EEXIT; undefined on AEX, same vibe πŸ’€
  • rdx β€” RDX at the time of EEXIT; undefined on AEX, fr fr
  • rsp β€” RSP (untrusted) at the time of EEXIT or AEX β€” that "untrusted" is important, bestie πŸ‘€
  • r8 β€” R8 at the time of EEXIT; undefined on AEX, ngl
  • r9 β€” R9 at the time of EEXIT; undefined on AEX, lowkey
  • run β€” the run instance given by the caller 🫢

πŸ”₯ DESCRIPTION πŸ”₯

the register parameters contain the snapshot of their values at enclave exit. that's the whole point, and it's iconic ✨

if the ENCLU function number is invalid, -EINVAL will be returned to the caller. periodt.

🌈 RETURN 🌈

vibe check on the return value:

  • <= 0 β€” the given value is returned back to the caller πŸ’…
  • > 0 β€” this is the ENCLU function to invoke, either EENTER or ERESUME πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file is ./arch/x86/include/uapi/asm/sgx.h, and these are the related pages you should also peek at:


mwah πŸ’‹ that's the page! source/version: ./arch/x86/include/uapi/asm, date: October 2026, and yes, it's still the sgx_enclave_user_handler_t(9) manual page, bestie. 🌸

πŸ“¦ where this page comes from