iommu_dma_prepare_msi(9)
β¨ iommu_dma_prepare_msi β¨
okay so bestie, welcome to the Kernel API Manual π this one's a little function with a big job: getting your MSI page actually mapped into the IOMMU domain. no cap, it's short, but it matters. let's get into it π
πΈ SYNOPSIS πΈ
int iommu_dma_prepare_msi (struct msi_desc *desc , phys_addr_t msi_addr );
like, two params, one int coming back at you. that's the whole vibe check π
π¦ ARGUMENTS π¦
descβ the MSI descriptor, and heads up: this is where the MSI page gets stored. so it's not just a read, it's literally the storage spot, main character energy fr π«Άmsi_addrβ the MSI target address that's gonna be mapped. that's the thing we're putting on the map πΊοΈβ¨
π DESCRIPTION π
so the implementation of sw_msi should take msi_addr, map it to an IOVA in the domain, and then call msi_desc_set_iommu_msi_iova with the mapping information. that's it. that's the whole assignment π
think of it as: grab the address β give it a home in the domain β tell everyone where it lives via msi_desc_set_iommu_msi_iova π« not me explaining IOMMU at 2am lmaooo but it's giving very clear instructions ngl.
β RETURN β
0 on success π β or a negative error code if the mapping failed π (yes, negative. it's a "something went wrong" situation, lowkey sad but that's how we report it).
π SEE ALSO π
okay bestie this list is iconic and honestly kind of long, so buckle up π’ β kernel file ./drivers/iommu/iommu.c and all of these:
iommu_device_register(9)iommu_insert_resv_region(9)iommu_group_alloc(9)iommu_group_get_iommudata(9)iommu_group_set_iommudata(9)iommu_group_set_name(9)iommu_group_add_device(9)iommu_group_remove_device(9)iommu_group_mutex_assert(9)iommu_group_for_each_dev(9)iommu_group_get(9)iommu_group_ref_get(9)iommu_group_put(9)iommu_group_id(9)device_iommu_capable(9)iommu_group_has_isolated_msi(9)iommu_set_fault_handler(9)iommu_paging_domain_alloc_flags(9)iommu_attach_device(9)iommu_get_domain_for_dev(9)iommu_driver_get_domain_for_dev(9)iommu_attach_group(9)iommu_unmap(9)iommu_unmap_fast(9)report_iommu_fault(9)iommu_get_resv_regions(9)iommu_put_resv_regions(9)iommu_setup_default_domain(9)iommu_device_use_default_domain(9)iommu_device_unuse_default_domain(9)iommu_group_claim_dma_owner(9)iommu_device_claim_dma_owner(9)iommu_group_release_dma_owner(9)iommu_device_release_dma_owner(9)iommu_group_dma_owner_claimed(9)iommu_replace_device_pasid(9)iommu_attach_handle_get(9)iommu_attach_group_handle(9)iommu_detach_group_handle(9)iommu_replace_group_handle(9)pci_dev_reset_iommu_prepare(9)pci_dev_reset_iommu_done(9)
like I said. a whole squad π«Ά
and that's the page, bestie!! ily, go map something π§π
sign-off szn πΈ: this lil beauty lives in ./drivers/iommu, dated October 2026, and it's brought to you by the iommu_dma_prepare_msi(9) girlies π
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