STRUCT HSMP_TELEMETRY_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 __u64 to 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 that buf points 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 -EINVAL rather than short-written, so don't even try it πŸ™ˆ. if you pass a smaller value, you get the leading size bytes 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 right size. 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