STRUCT IO_PGTABLE_CFG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so this is struct io_pgtable_cfg(9) from the Kernel API Manual, and it's literally the configuration data for a set of page tables. That's the whole vibe: one struct holding all the page-table knobs, bestie. 🫢

✨ SYNOPSIS ✨

struct io_pgtable_cfg {
  #define IO_PGTABLE_QUIRK_ARM_NS                 BIT(0);
  #define IO_PGTABLE_QUIRK_NO_PERMS               BIT(1);
  #define IO_PGTABLE_QUIRK_ARM_MTK_EXT            BIT(3);
  #define IO_PGTABLE_QUIRK_ARM_MTK_TTBR_EXT       BIT(4);
  #define IO_PGTABLE_QUIRK_ARM_TTBR1              BIT(5);
  #define IO_PGTABLE_QUIRK_ARM_OUTER_WBWA         BIT(6);
  #define IO_PGTABLE_QUIRK_ARM_HD                 BIT(7);
  #define IO_PGTABLE_QUIRK_ARM_S2FWB              BIT(8);
  #define IO_PGTABLE_QUIRK_NO_WARN                BIT(9);
    unsigned long                   quirks;
    unsigned long                   pgsize_bitmap;
    unsigned int                    ias;
    unsigned int                    oas;
    bool coherent_walk;
    const struct iommu_flush_ops    *tlb;
    struct device                   *iommu_dev;
    void *(*alloc)(void *cookie, size_t size, gfp_t gfp);
    void (*free)(void *cookie, void *pages, size_t size);
};

πŸ’… Members πŸ’…

Bestie, here's the field-by-field tea β˜• β€” every member, no skipping:

  • quirks β€” a bitmap of hardware quirks that require some special action by the low-level page table allocator. ✨
  • pgsize_bitmap β€” a bitmap of page sizes supported by this set of page tables. πŸ¦‹
  • ias β€” input address (iova) size, in bits.
  • oas β€” output address (paddr) size, in bits.
  • coherent_walk β€” a flag to indicate whether or not page table walks made by the IOMMU are coherent with the CPU caches.
  • tlb β€” TLB management callbacks for this set of tables.
  • iommu_dev β€” the device representing the DMA configuration for the page table walker.
  • alloc β€” custom page allocator. This is an optional hook used to allocate page tables. If this function is NULL, free must be NULL too. πŸ‘€

Memory returned should be zeroed and suitable for dma_map_single and virt_to_phys.

Not all formats support custom page allocators. Before considering passing a non-NULL value, make sure the chosen page format supports this feature.
  • free β€” custom page de-allocator. This is an optional hook used to free page tables allocated with the alloc hook. It must be non-NULL if alloc is not NULL, and it must be NULL otherwise. πŸ”₯

🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/io-pgtable.h
  • struct iommu_flush_ops(9)
  • struct arm_lpae_io_pgtable_walk_data(9)
  • struct io_pgtable_ops(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)

source/version: ./include/linux Β· date: October 2026 Β· page: struct io_pgtable_cfg(9) β€” mwah, bestie, go configure those page tables responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from