ibmvtpm_send_crq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the vio device struct πŸ‘‘ she's the main character here
  • valid β€” 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