STRUCT PANTHOR_MMU(9)
π NAME π
struct panthor_mmu β the MMU-related data, aka the whole memory-management situation for panthor, bestie. (this is page struct panthor_mmu(9) from the Kernel API Manual, in case the vibe check needed receipts β¨)
β¨ SYNOPSIS β¨
okay so here's the shape of it, literally copy-pasted energy, no cap:
struct panthor_mmu {
void __iomem *iomem;
struct panthor_irq irq;
struct {
struct mutex slots_lock;
unsigned long alloc_mask;
unsigned long faulty_mask;
struct panthor_as_slot slots[MAX_AS_SLOTS];
struct list_head lru_list;
} as;
struct {
struct mutex lock;
struct list_head list;
bool reset_in_progress;
struct workqueue_struct *wq;
} vm;
};
π MEMBERS π
iomemβ the CPU mapping of theMMU_AS_CONTROLiomem region. your girl's direct line to the registers πirqβ the MMU irq. it's giving "the interrupt, yes her" π₯asβ address space related fields π¦
lowkey important context: the GPU only has a limited number of address spaces (AS) slots, which means we're out here forced to re-assign them β re-assigning slots on-demand, bestie. it's a whole rotation π
as.slots_lockβ the lock protecting access to all the other AS fields. nobody touches the rest without her, periodt πas.alloc_maskβ bitmask encoding the allocated slots. every bit is a slot that's taken πas.faulty_maskβ bitmask encoding the faulty slots. the messy ones, flagged π©as.slotsβ the VMs currently bound to the AS slots πΈas.lru_listβ list of least recently used VMs π
and here's the why, because it's actually iconic: we use this list to pick a VM to evict when all the slots are used.
there should be no more active VMs than there are AS slots, so this LRU is just here to keep VMs bound until there's a need to release a slot β thus avoiding unnecessary TLB/cache flushes. efficiency queen behavior, fr fr β¨
vmβ the VMs management fields πvm.lockβ lock protecting access tolistπvm.listβ list containing all VMs. everyone's in the group chat π«Άvm.reset_in_progressβTrueif a reset is in progress. heads up, we're resetting rn πvm.wqβ workqueue used for theVM_BINDqueues βοΈ
π SEE ALSO π
kernel file ./drivers/gpu/drm/panthor/panthor_mmu.c, plus the whole bestie lineup β go read these next:
struct panthor_as_slot(9)struct panthor_vm_pool(9)struct panthor_vma(9)struct panthor_vm_op_ctx(9)struct panthor_vm(9)struct panthor_vm_bind_job(9)alloc_pt(9)free_pt(9)panthor_vm_has_unhandled_faults(9)panthor_vm_is_unusable(9)panthor_vm_active(9)panthor_vm_idle(9)panthor_vm_as(9)panthor_vm_alloc_va(9)panthor_vm_free_va(9)panthor_vm_get_bo_for_va(9)panthor_vm_pool_create_vm(9)panthor_vm_pool_destroy_vm(9)panthor_vm_pool_get_vm(9)panthor_vm_pool_destroy(9)panthor_vm_pool_create(9)panthor_mmu_suspend(9)panthor_mmu_resume(9)panthor_mmu_pre_reset(9)panthor_mmu_post_reset(9)panthor_vm_put(9)panthor_vm_get(9)panthor_vm_get_heap_pool(9)panthor_vm_heaps_sizes(9)panthor_vm_resv(9)panthor_vm_bind_job_put(9)panthor_vm_create(9)panthor_vm_bind_job_create(9)panthor_vm_bind_job_prepare_resvs(9)panthor_vm_bind_job_update_resvs(9)panthor_vm_bind_exec_sync_op(9)panthor_vm_map_bo_range(9)panthor_vm_unmap_range(9)panthor_vm_prepare_mapped_bos_resvs(9)panthor_mmu_unplug(9)panthor_mmu_init(9)panthor_mmu_debugfs_init(9)panthor_mmu_pt_cache_init(9)panthor_mmu_pt_cache_fini(9)
okay that's the whole page, mwah π this came out of ./drivers/gpu/drm/panthor, dated October 2026 β go drink some water and go read panthor_mmu.c, ily, bye π§ββοΈπ
π¦ 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