STRUCT PT_IOMMU_DRIVER_OPS(9)
π struct pt_iommu_driver_ops(9) β like, the Kernel API Manual page for the HW IOTLB cache flushing operations bestie π
okay so real talk, this is struct pt_iommu_driver_ops from the Kernel API Manual, and she's basically the little struct that tells your IOMMU driver how to do the HW IOTLB cache flushing vibe. no cap, she's kind of a big deal β¨
πΈ NAME πΈ
struct pt_iommu_driver_ops β HW IOTLB cache flushing operations, periodt π
π¦ SYNOPSIS π¦
struct pt_iommu_driver_ops {
void (*change_top)(struct pt_iommu *iommu_table, phys_addr_t
top_paddr, unsigned int top_level);
spinlock_t *(*get_top_lock)(struct pt_iommu *iommu_table);
};
lowkey iconic little struct, she's got exactly two members and both of them are about moving the top of the table without breaking everything π«Ά
β¨ Members β¨
π₯ change_top β update the top of table pointer
so this one takes these:
iommu_tableβ the table you're operating on, your main character πtop_paddrβ the new CPU physical address of the top pointertop_levelβ the IOMMU PT level of the new top
She's called under the get_top_lock spinlock, and the driver's job is to update all the HW references to this domain with a new top address and configuration. On return, mappings placed in the new top must be reachable by the HW β like, no sneaky leftover references, mkay? π
top_level encodes the level in IOMMU PT format, and level 0 is the smallest page size, increasing from there. You have to translate that into whatever HW-specific format you got going on. And during this call the new top will not be visible to any other API β so it's a whole private little moment, iykyk π
this op is only used by PT_FEAT_DYNAMIC_TOP, and it's required if that's enabled. no skipping it bestie.
π§ get_top_lock β the lock to hold when changing the table top
iommu_tableβ the table to operate on
Returns a lock to hold when changing the table top page table from being stored in HW. That lock will be held prior to calling change_top and released once the top is fully visible. she's giving chaperone energy π
Typically this would be a lock that protects the iommu_domain's attachment list. like, that's the usual vibe.
same deal: only used by PT_FEAT_DYNAMIC_TOP, and required if enabled. β
π Description π
The IOMMU driver should implement these using container_of(iommu_table) to get to its iommu_domain-derived structure. And heads up β all ops can be called in atomic contexts because they're buried under DMA API calls π so like, no sleeping in there, fr fr.
π SEE ALSO π
- Kernel file
./include/linux/generic_pt/iommu.h IOMMU Radix Page Table(9)struct pt_iommu(9)struct pt_iommu_info(9)struct pt_iommu_cfg(9)
okay that's the whole page, you ate that π this came from ./include/linux/generic_pt, dated October 2026, and it's struct pt_iommu_driver_ops(9) β go forth and flush those caches responsibly, bestie ππΈ
π¦ 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