__iommu_copy_struct_to_user(9)
π __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 astruct iommu_user_datafor 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 ininclude/uapi/linux/iommufd.h. so that's where the actual tea comes from πdata_typeβ The data type of thesrc_data. Must match withdst_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 beoffsetofendusing the last member in the user data struct that was initially added toinclude/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 π
- Kernel file
./include/linux/iommu.hβ the source of truth, the mothership π struct iommu_fault_page_request(9)struct iommu_fault(9)enum iommu_page_response_code(9)struct iommu_page_response(9)struct iopf_queue(9)struct iommu_resv_region(9)struct iommu_iotlb_gather(9)struct iommu_dirty_bitmap(9)struct iommu_dirty_ops(9)struct iommu_user_data(9)struct iommu_user_data_array(9)__iommu_copy_struct_from_user(9)iommu_copy_struct_from_user(9)__iommu_copy_struct_from_user_array(9)iommu_copy_struct_from_user_array(9)iommu_copy_struct_from_full_user_array(9)iommu_copy_struct_to_user(9)β that's the non-underscore sibling, hi bestie πstruct iommu_ops(9)struct iommu_domain_ops(9)struct iommu_device(9)struct iommu_fault_param(9)struct dev_iommu(9)iommu_iotlb_gather_is_disjoint(9)iommu_iotlb_gather_add_range(9)iommu_iotlb_gather_add_page(9)struct iommu_fwspec(9)struct iommu_sva(9)iommu_map_sgtable(9)
like, that's the whole friend group, and they all ate π₯
ngl if you ever forget the exact struct member rules formin_len, just go readinclude/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
- 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