STRUCT SGX_PCMD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct sgx_pcmd(9) ✨

okay so bestie, we're in the Kernel API Manual today and the main character is struct sgx_pcmd β€” no cap, this little guy is lowkey important πŸ’…


πŸŽ€ NAME πŸŽ€

struct sgx_pcmd β€” Paging Crypto Metadata, aka PCMD (say it with me: pee-see-em-dee, it's giving acronym royalty πŸ‘‘)


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole glow-up, exactly as it lives in the header:

struct sgx_pcmd {
    struct sgx_secinfo secinfo;
    u64 enclave_id;
    u8 reserved[SGX_PCMD_RESERVED_SIZE];
    u8 mac[16];
 };

like, that's the layout, don't touch it, she's perfect 🫢


🌸 Members 🌸

  • enclave_id β€” the enclave identifier, i.e. which enclave this whole situation belongs to 🏠
  • mac β€” the MAC over PCMD, page contents and isvsvn β€” she's the security guard checking everyone's vibe at the door πŸ”

πŸ’– Description πŸ’–

so here's the tea β˜• β€” PCMD gets stored for every swapped page to the regular memory. every single one. it's booked and busy, fr fr.

then when ELDU loads the page back, it recalculates the MAC by using an isvsvn number stored in a VA page. together, these two structures bring you integrity and rollback protection βœ¨πŸ”’ β€” literally the duo we didn't know we needed, main character energy from both of them ngl.


🌈 SEE ALSO 🌈

go read the kernel file ./arch/x86/include/asm/sgx.h β€” it's the source of truth bestie, drink your water and read your header πŸ’œ

and then the whole friend group:

  • SGX_ENCLS_FAULT_FLAG(9)
  • enum sgx_return_code(9)
  • enum sgx_miscselect(9)
  • enum sgx_attribute(9)
  • struct sgx_secs(9)
  • enum sgx_tcs_flags(9)
  • struct sgx_tcs(9)
  • struct sgx_pageinfo(9)
  • enum sgx_page_type(9)
  • enum sgx_secinfo_flags(9)
  • struct sgx_secinfo(9)
  • struct sgx_sigstruct_header(9)
  • struct sgx_sigstruct_body(9)
  • struct sgx_sigstruct(9)

okay that's the whole page, no notes πŸ’€

aaaand that's a wrap, bestie 🎬 β€” this one came to you from ./arch/x86/include/asm, dated October 2026, and it's literally struct sgx_pcmd(9). slay, go forth and swap your pages securely πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from