STRUCT HSMP_TELEMETRY_DATA(9)
π struct hsmp_telemetry_data(9) π
okay so bestie, welcome to the Kernel API Manual page for struct hsmp_telemetry_data β she's the request descriptor for the HSMP telemetry IOCTL, and honestly? she's iconic. let's get into it π«Ά
β¨ NAME β¨
struct hsmp_telemetry_data β the request descriptor for the HSMP telemetry IOCTL. that's her job, that's her whole vibe π
πΈ SYNOPSIS πΈ
struct hsmp_telemetry_data {
__u64 buf;
__u32 size;
__u16 sock_ind;
__u16 reserved;
};
look at that little 16-byte queen. no notes. π
π Members π
bufβ Input. this is a userspace pointer to the destination buffer that receives the metric table, and it's encoded as a__u64to keep the layout stable between 32-bit and 64-bit callers. one struct, both worlds, no drama β¨sizeβ Input. it's the size in bytes of the buffer thatbufpoints to, and also the number of bytes copied out on success. it must be non-zero, and it can't be bigger than the metric table size firmware reports for this socket β a larger value gets rejected with-EINVALrather than short-written, so don't even try it π. if you pass a smaller value, you get the leadingsizebytes of the snapshot, which is lowkey a cute little preview. and heads up: the kernel does not write this field back, so don't go looking for a return value here πsock_indβ Input. the socket index from which the metric table is read. you pick the socket, she reads the table π¦reservedβ Reserved for future use. callers should set this to zero, fr fr. future kernels may begin interpreting this field, so passing a non-zero value today is not forwards compatible β like, it's giving "living in the past," and not in a nostalgic way π
π Description π
putting buf first lets all the fields fall on their natural alignment under the surrounding #pragma pack(4), so the struct is a tight 16 bytes with the same wire layout on both 32-bit and 64-bit userspace. symmetric, compact, ate. π₯
the metric table layout depends on the HSMP protocol version that firmware reports β and bestie, userspace can read that from the protocol_version sysfs attribute, so go check it, iykyk π.
protocol version 6 uses struct hsmp_metric_table, so callers on that version pass sizeof(struct hsmp_metric_table). the later version metrics table layout is documented in the Public PPR. that's the whole plot π§
ok but seriously, pass the rightsize. too big =-EINVAL, and we do NOT want that energy in your dmesg π
π« SEE ALSO π«
- Kernel file
./arch/x86/include/uapi/asm/amd_hsmp.hβ go read her, she's got the lore π
mwah, that's the page π this whole thing lives under ./arch/x86/include/uapi/asm, and the version/date stamp on it is October 2026 β future-coded and slaying, periodt ππ
π¦ 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