vfio_ap_le_guid_to_be_uuid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so <rainbow>vfio_ap_le_guid_to_be_uuid</rainbow> β€” bestie, this is the little glow-up function that takes a little endian guid array and turns it into an array of big endian elements, so you can hand them over by value to an s390dbf sprintf event function and get a pretty UUID string out the other side. it's giving "endianness makeover" ✨

this page lives in the Kernel API Manual, and honestly? iconic behaviour πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

void vfio_ap_le_guid_to_be_uuid (guid_t *guid , unsigned long *uuid );

🌸 ARGUMENTS 🌸

  • guid β€” the object holding the little endian guid. this is the input, the raw material, the before picture 🫢
  • uuid β€” a six-element array of long values that you can pass by value as arguments for a formatting string that specifies a UUID. yes, six. not five, not seven. six πŸ’…

✨ DESCRIPTION ✨

so here's the tea β˜• the S390 Debug Feature (s390dbf) will totally let you use "s" in the sprintf event functions β€” but only if the memory for the passed string stays available for as long as the debug feature exists. sounds fine, right? 😭 wrong. a mediated device can be removed at any time, which means you cannot just use its name, because s passes a reference to the string in memory β€” and that reference goes stale the second the device gets removed. not the vibe. πŸ’€

and it gets worse (jk, it gets interesting). the s390dbf string formatting function allows a maximum of 9 arguments for a message displayed in the 'sprintf' view. so if you want to use the bytes that make up the mediated device's UUID to display the mediated device name, you've gotta convert them into an array whose elements can be passed by value to sprintf. lowkey elegant, highkey necessary 🧚

for example:

guid array: { 83, 78, 17, 62, bb, f1, f0, 47, 91, 4d, 32, a2, 2e, 3a,
88, 04 } mdev name: 62177883-f1bb-47f0-914d-32a22e3a8804 array returned:
{ 62177883, f1bb, 47f0, 914d, 32a2, 2e3a8804 } formatting string:
"08lx-04lx-04lx-04lx-02lx04lx"

look at that transformation. genuinely ate. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/s390/crypto/vfio_ap_ops.c β€” go read the source, bestie, it's right there 🫢

and the whole friend group, in order:


okay that's the whole page, no cap πŸ’–

and that's a wrap, bestie! 🌈 this little beauty comes from ./drivers/s390/crypto, dated October 2026, and it goes by vfio_ap_le_guid_to_be_uuid(9) β€” remember the name, she's famous now. mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from