STRUCT TSM_MEASUREMENTS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct tsm_measurements β€” the Kernel API Manual moment ✨

okay so bestie, welcome to the glow-up of struct tsm_measurements(9) β€” this is the literal blueprint for the CC architecture's very own measurement facility, plus all the methods for updating measurement registers (MRs). she's giving main character energy in the TSM world, no cap πŸŽ€


🌸 NAME 🌸

struct tsm_measurements β€” defines the CC architecture specific measurement facility and the methods for updating measurement registers (MRs). that's it, that's the whole vibe πŸ’–


✨ SYNOPSIS ✨

struct tsm_measurements {
    const struct tsm_measurement_register *mrs;
    size_t nr_mrs;
    int (*refresh)(const struct tsm_measurements *tm);
    int (*write)(const struct tsm_measurements *tm, const struct tsm_measurement_register *mr, const u8 *data);
};

🫢 Members 🫢

  • mrs β€” the array of MR definitions. like, the whole squad of registers, lined up πŸ’…
  • nr_mrs β€” the number of elements in mrs. gotta know how many besties are in the array fr fr 🌈
  • refresh β€” callback function that loads/syncs all the MRs from TVM hardware/firmware into the kernel cache. she's the one who goes out and brings the whole group back home πŸ”₯
  • write β€” callback function that writes to the MR specified by the parameter mr. typically, writing to an MR extends the input buffer to that MR. iconic behaviour honestly ✨

πŸ’œ Description πŸ’œ

so the refresh callback gets invoked when an MR with TSM_MR_F_LIVE set is being read and the cache is stale 😭 (stale cache is such a mood). it must reload all MRs with TSM_MR_F_LIVE set β€” all of them, no skipping, not me letting one slide πŸ™ˆ. the function parameter tm is a pointer pointing back to this structure, iykyk, she knows where she came from πŸ’«

the write callback gets invoked whenever an MR is being written. it takes two additional parameters besides tm, and yes we're listing them because they matter:

  • mr β€” points to the MR (an element of tm->mrs) being written. it's literally one of the array girlies πŸ‘‘
  • data β€” contains the bytes to write, and its size is mr->mr_size. respect the size, bestie, always πŸ“
both refresh and write should return 0 on success and an appropriate error code on failure. zero means slay, anything else means something went sideways πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./include/linux/tsm-mr.h
  • struct tsm_measurement_register(9)

and that's the whole page, bestie πŸ’– this gem lives in ./include/linux, stamped October 2026, and it's officially struct tsm_measurements(9) β€” go forth and measure those registers, periodt πŸ§šβ€β™€οΈπŸŒΈ

πŸ“¦ where this page comes from