sgx_encl_alloc_backing(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sgx_encl_alloc_backing(9) β€” the kernel API manual, bestie edition πŸŽ€

okay so the manual name is sgx_encl_alloc_backing, section 9 of the Kernel API Manual, and honestly? she's a little niche but she serves. come sit with me 🫢


✨ NAME ✨

sgx_encl_alloc_backing β€” literally just creating a brand new backing storage page, no big deal πŸ’–

🌸 SYNOPSIS 🌸

int sgx_encl_alloc_backing (struct sgx_encl *encl , unsigned long
page_index , struct sgx_backing *backing );

that's the whole vibe check right there πŸ‘‘

πŸ¦‹ ARGUMENTS πŸ¦‹

  • encl β€” an enclave pointer, bestie. it's giving "the main character" 🧚
  • page_index β€” the enclave page index, aka where in the page lineup we're at πŸ”₯
  • backing β€” data for accessing the backing storage for the page. the lil access pass πŸŽ€

πŸ’œ DESCRIPTION πŸ’œ

okay so picture this. when this gets called from ksgxd, it sets the active memcg from one of the mms in the enclave's mm_list before any backing page allocation happens β€” the whole point being to make sure those shmem page allocations get charged to the enclave, no cap 😀✨

then it creates a backing page so you can load data back into an EPC page with ELDU. iconic behavior, honestly.

🚨 important bestie alert: this function takes a reference on a new backing page, and you must drop it with a corresponding call to sgx_encl_put_backing. don't leave her hanging, that's so not slay πŸ’€

⭐ RETURN ⭐

0 on success, -errno otherwise. that's it, that's the whole story 🌈

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file, right here in the flesh:

./arch/x86/kernel/cpu/sgx/encl.c

and a whole friend group of cross-references, all of them absolutely invited to the group chat πŸ’…:


🌸 mwah, that's the page! this iconic little number lives at ./arch/x86/kernel/cpu/sgx, dated October 2026, and it goes by sgx_encl_alloc_backing(9). periodt πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from