__iommu_copy_struct_to_user(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __iommu_copy_struct_to_user β€” NAME πŸ’–

okay so bestie, this lil function is called __iommu_copy_struct_to_user, and its whole ~vibe~ is: report iommu driver specific user space data πŸ’…βœ¨ It's from the Kernel API Manual (that's the manpage family it lives in, iykyk) and honestly? it's doing the most for backward compatibility. 🫢


✨ SYNOPSIS ✨

int __iommu_copy_struct_to_user (const struct iommu_user_data *dst_data
, void *src_data , unsigned int data_type , size_t data_len , size_t
min_len );

that's the whole signature, no cap 🧚 like yes it's five whole arguments, we love a thorough queen πŸ‘‘


🌸 ARGUMENTS 🌸

okay let's go through them one by one, bestie, don't skip πŸŽ€

  • dst_data β€” Pointer to a struct iommu_user_data for user space data location. it's literally the map to where the user space data lives πŸ—ΊοΈ
  • src_data β€” Pointer to an iommu driver specific user data that is defined in include/uapi/linux/iommufd.h. so that's where the actual tea comes from πŸ’–
  • data_type β€” The data type of the src_data. Must match with dst_data.type β€” like, they HAVE to match, it's giving matching friendship bracelets, no exceptions πŸ™ˆ
  • data_len β€” Length of current user data structure, i.e. sizeof(struct _src). yes the size, we measure things around here πŸ“
  • min_len β€” Initial length of user data structure for backward compatibility. This should be offsetofend using the last member in the user data struct that was initially added to include/uapi/linux/iommufd.h. that's the backwards-compat clause, the "we still love our old versions" of it all 🫢✨

πŸ¦‹ SEE ALSO πŸ¦‹

the reference list is LONG bestie, like a group chat with everyone in it, but every single one is here, mwah πŸ’‹

like, that's the whole friend group, and they all ate πŸ”₯


ngl if you ever forget the exact struct member rules for min_len, just go read include/uapi/linux/iommufd.h β€” the manpage said so, and I'm just the messenger πŸ’€

πŸŽ€ sign-off πŸŽ€

this iconic lil page came from ./include/linux, dated October 2026, and it's filed under __iommu_copy_struct_to_user(9) β€” periodt. πŸ’œπŸŒΈ go forth and copy those structs to user space, bestie, you've got this 🫢✨

πŸ“¦ where this page comes from