sgx_encl_lookup_backing(9)
π 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, obviouslypage_indexβ enclave page index π the index of the page inside the enclavebackingβ 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 π:
reclaimer_writing_to_pcmd(9)sgx_encl_eaug_page(9)sgx_encl_may_map(9)sgx_encl_release(9)sgx_encl_cpumask(9)__sgx_encl_get_backing(9)sgx_encl_alloc_backing(9)sgx_encl_put_backing(9)sgx_encl_test_and_clear_young(9)sgx_zap_enclave_ptes(9)sgx_alloc_va_page(9)sgx_alloc_va_slot(9)sgx_free_va_slot(9)sgx_va_page_full(9)sgx_encl_free_epc_page(9)
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
- 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