STRUCT PANTHOR_MMU(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 the MMU_AS_CONTROL iomem 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 to list πŸ”
  • vm.list β€” list containing all VMs. everyone's in the group chat 🫢
  • vm.reset_in_progress β€” True if a reset is in progress. heads up, we're resetting rn πŸ’€
  • vm.wq β€” workqueue used for the VM_BIND queues βš™οΈ

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/gpu/drm/panthor/panthor_mmu.c, plus the whole bestie lineup β€” go read these next:


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