STRUCT TSM_MEASUREMENTS(9)
π 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 inmrs. 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 parametermr. 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 oftm->mrs) being written. it's literally one of the array girlies πdataβ contains the bytes to write, and its size ismr->mr_size. respect the size, bestie, always π
bothrefreshandwriteshould return0on 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
- 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