STRUCT IO_PGTABLE_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct io_pgtable_ops(9) β€” Kernel API Manual

okay bestie, so this is struct io_pgtable_ops, and it's literally the page table manipulation API for IOMMU drivers. that's the whole vibe. πŸŽ€


✨ NAME ✨

struct io_pgtable_ops β€” the page table manipulation API for IOMMU drivers. no cap, that's what it is. πŸ¦‹


🌸 SYNOPSIS 🌸

struct io_pgtable_ops {
    int (*map_pages)(struct io_pgtable_ops *ops, unsigned long iova,
phys_addr_t paddr, size_t pgsize, size_t pgcount, int prot, gfp_t gfp,
size_t *mapped);
    size_t (*unmap_pages)(struct io_pgtable_ops *ops, unsigned long
iova, size_t pgsize, size_t pgcount, struct iommu_iotlb_gather *gather);
    phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops, unsigned
long iova);
    int (*pgtable_walk)(struct io_pgtable_ops *ops, unsigned long iova,
void *wd);
    int (*read_and_clear_dirty)(struct io_pgtable_ops *ops, unsigned
long iova, size_t size, unsigned long flags, struct iommu_dirty_bitmap
*dirty);
 };

like, look at all those function pointers. she's got range. πŸ’…


πŸ‘‘ Members πŸ‘‘

  • map_pages β€” maps a physically contiguous range of pages that are all the same size. iconic behaviour honestly. ✨
  • unmap_pages β€” unmaps a range of virtually contiguous pages that are all the same size. the reverse slay. πŸ¦‹
  • iova_to_phys β€” translates an iova into a physical address. the little matchmaker between virtual and physical, iykyk. πŸ’–
  • pgtable_walk β€” (optional) performs a page table walk for a given iova. optional means you don't have to, but if you do… main character energy. 🌟
  • read_and_clear_dirty β€” records dirty info per IOVA. if an IOVA is dirty, it clears its dirty state from the PTE β€” unless the IOMMU_DIRTY_NO_CLEAR flag is passed in. read the flag, bestie, or the dirty bit stays. πŸ’€

🌈 Description 🌈

these functions map directly onto the iommu_ops member functions with the same names. same names, same energy, no middleman drama. periodt. 🫢


πŸŽ€ SEE ALSO πŸŽ€

  • kernel file ./include/linux/io-pgtable.h
  • struct iommu_flush_ops(9)
  • struct io_pgtable_cfg(9)
  • struct arm_lpae_io_pgtable_walk_data(9)
  • alloc_io_pgtable_ops(9)
  • free_io_pgtable_ops(9)
  • struct io_pgtable(9)
  • enum io_pgtable_caps(9)
  • struct io_pgtable_init_fns(9)

go read them all, I'll wait. πŸ’œ


and that's the page!! πŸ“ this little gem lives in ./include/linux, dropping with the October 2026 energy, so like… cite me accordingly bestie. mwah. πŸ’–βœ¨πŸ§š

πŸ“¦ where this page comes from