sgx_encl_lookup_backing(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sgx_encl_lookup_backing(9) β€” like, the Kernel API Manual, bestie ✨

okay so this is a page from the Kernel API Manual and honestly? it's giving "small function, big responsibilities." stay with me 🫢

🌸 NAME 🌸

sgx_encl_lookup_backing β€” retrieve an existing backing storage page. that's it. that's the whole vibe. no cap ✨

πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ ARGUMENTS πŸ¦‹

  • encl β€” an enclave pointer πŸ‘‘ like, the enclave you're working with, obviously
  • page_index β€” enclave page index πŸ“‡ the index of the page inside the enclave
  • backing β€” data for accessing backing storage for the page πŸ“ it's the struct that lets you get at the backing storage for that page

✨ DESCRIPTION ✨

So what does it do? It retrieves a backing page for loading data back into an EPC page with ELDU. iconic behavior, no notes πŸ’…

Now here's the part where you gotta pay attention, bestie, because this is the caller's responsibility: it is on you to make sure it's actually appropriate to use sgx_encl_lookup_backing rather than sgx_encl_alloc_backing. And if lookup is not used correctly? 😭 it will cause an allocation which is not accounted for. not me warning you dramatically β€” it's literally in the docs, fr fr.

🚨 real talk: misuse of lookup = an unaccounted allocation. that's the danger zone. use the right function for the right moment, periodt.

Also, this function takes a reference on an existing backing page, and that reference must be dropped with a corresponding call to sgx_encl_put_backing. so don't just walk away from it, girl β€” clean up your references πŸ”₯

⭐ RETURN ⭐

0 on success, -errno otherwise. short, sweet, and to the point πŸŽ€

🌈 SEE ALSO 🌈

Kernel file ./arch/x86/kernel/cpu/sgx/encl.c β€” like, go read the source, iykyk πŸ“–

and the whole friend group πŸ’œ:


okay that's the page!! 🫢 this whole thing lives over in ./arch/x86/kernel/cpu/sgx and it's dated October 2026 β€” so yeah, future-dated manpage energy, main character behavior honestly πŸ’€βœ¨ bye bestie, go drop those references!! 🌸

πŸ“¦ where this page comes from