Expand description
TLB (Translation Lookaside Buffer) shootdown for SMP.
When a page table entry is modified on one CPU, all other CPUs that might have cached that entry in their TLB must be notified to invalidate it.
This implementation uses a per-CPU mailbox system inspired by Asterinas:
- Each CPU has its own queue of pending TLB operations.
- The initiator pushes an operation into each target’s queue.
- The initiator sends a TLB shootdown IPI to all targets.
- The targets process their own queue and set an ACK flag.
- The initiator waits for all ACK flags to become true.
This avoids global lock contention and race conditions on global counters.
Functions§
- init
- Initialize TLB shootdown system.
- shootdown_
all - Flush all TLB entries on all CPUs.
- shootdown_
page - Invalidate a single page on all CPUs.
- shootdown_
range - Invalidate a range of pages on all CPUs.
- tlb_
shootdown_ ipi_ handler - IPI handler for TLB shootdown (called on receiving CPU).