STRUCT SVSM_VTPM_CMD_REQUEST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct svsm_vtpm_cmd_request(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual β€” yes we're literally reading kernel docs together, this is our friendship era πŸ’– and today's main character is this struct, no cap.


✨ NAME ✨

struct svsm_vtpm_cmd_request β€” the structure you use for a TPM_SEND_COMMAND request. that's it, that's the vibe 🫢


🌸 SYNOPSIS 🌸

struct svsm_vtpm_cmd_request {
    u32 cmd;
    u8 locality;
    u32 buf_size;
    u8 buf[];
 };

like look at her. iconic layout. lowkey obsessed πŸ’…


πŸ’œ MEMBERS πŸ’œ

  • cmd β€” the command you're sending, and heads up: it must be TPM_SEND_COMMAND. not optional, not vibes-based, just that one πŸ”₯
  • locality β€” the locality. that's the whole description bestie, she's mysterious like that 🧚
  • buf_size β€” the size of the input buffer that follows ✨
  • buf β€” a buffer of size buf_size. so like, exactly as big as you said it was πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

this whole thing is defined by the AMD SVSM spec [1], in the section "8.2 SVSM_VTPM_CMD Call" β€” Table 16: TPM_SEND_COMMAND Request Structure. and because tables are not the moment here, let me lay the bytes out for you, one icon at a time:

  • Byte Offset 0x000 β€” Size (Bytes) 4 β€” Meaning: Platform command (8)
  • Byte Offset 0x004 β€” Size (Bytes) 1 β€” Meaning: Locality (must-be-0)
  • Byte Offset 0x005 β€” Size (Bytes) 4 β€” Meaning: TPM Command size (in bytes)
  • Byte Offset 0x009 β€” Size (Bytes) Variable β€” Meaning: TPM Command

see? 0x000 β†’ 0x004 β†’ 0x005 β†’ 0x009. the way the offsets just line up, it's giving organized queen πŸ‘‘


⭐ NOTE ⭐

real talk bestie, the TCG Simulator expects buf_size to be equal to the size of the specific TPM command. if you fudge it, you get a TPM_RC_COMMAND_SIZE error back. so like… don't do that πŸ’€

🌈 SEE ALSO 🌈

the whole friend group honestly, go read all of them πŸ“


and that's the page! sourced from ./include/linux, dated October 2026, filed under struct svsm_..._cmd_request(9) β€” mwah, love u, go write some TPM commands responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from