__encls_N(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __encls_N β€” okay so this is the ENCLS encoder for the no-error-code girlies

bestie. welcome to section 9 of the Kernel API Manual, aka the kernel-manpage section, aka where the macro lore lives. today we're talking about __encls_N β€” a macro that encodes an ENCLS function that doesn't return an error code. that's the whole vibe. no error code, no drama, periodt. ✨


πŸŽ€ SYNOPSIS πŸŽ€

__encls_N (rax , rbx_out , inputs... );

like, look at her. three little slots and she's done. iconic.


🌸 ARGUMENTS 🌸

  • rax β€” the function number. which ENCLS function are we even doing here. that one. 🫢
  • rbx_out β€” an optional output variable. only if you need it, no pressure.
  • inputs β€” the asm inputs for the function. feed her.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what she actually does: she emits assembly for an ENCLS function that does not return an error code β€” think ECREATE, that kind of energy. πŸ’…

and here's the key thing, the part you cannot skip: leaves without error codes either succeed or fault. there's no in-between, no "oops here's a return value", none of that. it works or it traps. main character behaviour fr fr.

rbx_out is an optional parameter for use by EDGBRD, which returns the requested value in RBX. so if you're the EDGBRD girlie, that's your slot. iykyk. 🧚


⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • trapnr with SGX_ENCLS_FAULT_FLAG set on fault πŸ’€

like i said. succeed or fault. no cap.


🌈 SEE ALSO 🌈


lowkey reminder bestie: if it faults you're getting a trapnr back with SGX_ENCLS_FAULT_FLAG set, so check that flag before you assume anything. 🫢

mwah πŸ’‹ that's the page! this little love letter lives in the kernel source tree at ./arch/x86/kernel/cpu/sgx, and it's dated October 2026 β€” so yeah, she's from the future and she's still serving __encls_N(9). go forth and encode, queen πŸ‘‘βœ¨

πŸ“¦ where this page comes from