tpm2_do_selftest(9)
π 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_SUCCESSonce every last test came back successful πβ¨ - or it can choose to run those tests asynchronously and immediately return
RC_TESTINGwhile 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:
tpm2_calc_ordinal_duration(9)tpm2_pcr_read(9)tpm2_pcr_extend(9)tpm2_get_random(9)tpm2_flush_context(9)tpm2_get_tpm_pt(9)tpm2_shutdown(9)tpm2_probe(9)tpm2_startup(9)tpm2_auto_startup(9)
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
- 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