Allowed / TLB hit Table walk (TLB miss) Blocked at IOMMU (fault)

DMA Attack Surface 2D: Page-Table Walk & TLB Locality

This 2D companion to the 3D DMA/IOMMU simulator keeps the same Thunderbolt attack-surface story but models the translation mechanism itself: a real two-level page-table walk (L1 index from bits 5-9, L0 index from bits 0-4 of a 10-bit device address) backed by a small LRU-managed TLB. A trusted peripheral's requests stay inside its narrow mapped window and build up strong TLB locality; a malicious device scanning the full address space gets almost no cache benefit and, whenever the IOMMU is on, is blocked outright unless it happens to land inside the mapped window. Toggle the IOMMU, switch device behavior, and resize the DMA window or the TLB itself to watch the hit-rate, table-walk count and translation latency respond in real time — turn the IOMMU off and watch a scanning device reach kernel and secret physical pages directly, with no translation at all.