ibmvtpm_send_crq(9)
π ibmvtpm_send_crq(9) β like, the Kernel API Manual, section 9 bestie β¨
okay so real talk, this is <hotpink>ibmvtpm_send_crq</hotpink> from the Kernel API Manual (that's the 9 section, iykyk) and it's genuinely the moment you send a CRQ request. CRQ!! iconic acronym. let's get into it π«Ά
πΈ NAME πΈ
ibmvtpm_send_crq β send a CRQ request π
β¨ SYNOPSIS β¨
int ibmvtpm_send_crq (struct vio_dev *vdev , u8 valid , u8 msg , u16 len
, u32 data );
π ARGUMENTS π
vdevβ theviodevice struct π she's the main character herevalidβ the Valid field β¨msgβ the Type field π·οΈlenβ the Length field πdataβ the Data field πΎ
π¦ DESCRIPTION π¦
bestie. the ibmvtpm crq is defined like this, and I need you to look at it with me, okay:
Byte | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
-----------------------------------------------------------------------
Word0 | Valid | Type | Length | Data
-----------------------------------------------------------------------
Word1 | Reserved
-----------------------------------------------------------------------
which is literally a perfect match for the following structure (on a bigendian host):
struct ibmvtpm_crq { u8 valid; u8 msg; __be16 len; __be32 data; __be64
reserved; } __attribute__((packed, aligned(8)));
BUT β and this is the part that's giving plot twist π β the value gets passed in a register, so you just compute the numeric value to load into that register and skip the byteswap altogether. no byteswapping, we're not doing that today π
endian only affects memory loads and stores, fr fr β registers are internally represented the same way. so like, the endianness drama simply does not apply up in here π
π₯ RETURN π₯
0(H_SUCCESS) β success, slay, we ate π- Non-zero β failure, it's giving sad girl hours π
π SEE ALSO π
kernel file ./drivers/char/tpm/tpm_ibmvtpm.c plus the whole friend group:
ibmvtpm_send_crq_word(9), tpm_ibmvtpm_recv(9), ibmvtpm_crq_send_init(9), tpm_ibmvtpm_resume(9), tpm_ibmvtpm_send(9), ibmvtpm_crq_get_rtce_size(9), ibmvtpm_crq_get_version(9), ibmvtpm_crq_send_init_complete(9), tpm_ibmvtpm_remove(9), tpm_ibmvtpm_get_desired_dma(9), tpm_ibmvtpm_suspend(9), ibmvtpm_reset_crq(9), ibmvtpm_crq_get_next(9), ibmvtpm_crq_process(9), ibmvtpm_interrupt(9), tpm_ibmvtpm_probe(9), ibmvtpm_module_init(9), ibmvtpm_module_exit(9)
π real one heads up: everything above is the actual spec, I'm just being loud about it. don't @ me if you byteswap when you shouldn't have.
okay that's the whole page, mwah π«Ά so this little love letter lives in ./drivers/char/tpm and it's stamped October 2026 β go forth and send your CRQs, 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