Skip to main content

Module memory

Module memory 

Source
Expand description

The bridge between the interpreter’s memory interface and the Mmu.

VmMemory is a hybrid, and deliberately so. Guest process memory — the default RAM space — goes through the MMU, where it gets mapping, permissions, and faults. Every other space keeps the flat representation the emulator already uses:

  • Register and unique spaces are not process memory at all. They are architectural state and per-instruction scratch, addressed by the lifter rather than the guest. There is no meaningful sense in which a write to RAX could be “unmapped”, and putting a page lookup on that path would tax the single hottest operation in the interpreter.
  • Temporary spaces are per-function IR storage, invisible to the guest.

So the MMU is applied exactly where guest-visible addressing happens, and nowhere else.

Structs§

VmMemory
Memory for a VM run: an Mmu for the RAM space, flat storage elsewhere.