STRUCT SVSM_VTPM_CMD_REQUEST(9)
π 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 beTPM_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 sizebuf_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 expectsbuf_sizeto be equal to the size of the specific TPM command. if you fudge it, you get aTPM_RC_COMMAND_SIZEerror back. so likeβ¦ don't do that π
π SEE ALSO π
- Kernel file
./include/linux/tpm_svsm.h(the source of truth, go visit her) struct svsm_vtpm_request(9)struct svsm_vtpm_response(9)struct svsm_vtpm_cmd_response(9)svsm_vtpm_cmd_request_fill(9)svsm_vtpm_cmd_response_parse(9)
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
- 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