tpm2_do_selftest(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– tpm2_do_selftest(9) πŸ’–

okay so this is a page from the Kernel API Manual (section 9, bestie, we're in kernel-land now) and it's all about tpm2_do_selftest β€” the little function that makes sure your TPM actually did its homework before anyone trusts it. let's get into it 🫢


✨ NAME ✨

tpm2_do_selftest β€” literally just making sure every self test has passed. that's it. that's the vibe check. πŸ’…


🌸 SYNOPSIS 🌸

int tpm2_do_selftest (struct tpm_chip *chip );

like, one argument, returns an int. minimal. iconic. no notes. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • chip β€” the TPM chip you're working with. that's the one, bestie. πŸ’–

πŸ¦‹ RETURN πŸ¦‹

Same as with tpm_transmit_cmd. (yep, that's the whole thing β€” it just passes the result along, no extra drama 🌈)


πŸ”₯ DESCRIPTION πŸ”₯

so here's the situation. your TPM has two whole modes for running its self tests and honestly both are valid:

  • it can run all the self tests synchronously and then hand you back RC_SUCCESS once every last test came back successful 😌✨
  • or it can choose to run those tests asynchronously and immediately return RC_TESTING while the self tests are still executing in the background πŸ‘€

and this function? this function handles both cases, no cap. it waits until all the tests have completed, so you don't have to sit there refreshing like it's a group chat. main character energy honestly. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/char/tpm/tpm2-cmd.c, plus the whole friend group:


ngl, if you're reading a section 9 manpage you're already kind of a legend. drink some water. πŸ“

and that's the whole page!! mwah πŸ’‹ β€” this one lives in ./drivers/char/tpm and it's stamped October 2026, so like, future-coded of it. see u in the next manpage bestie πŸ§šβ€β™€οΈπŸ’–πŸŒΈ

πŸ“¦ where this page comes from