Expand description
s9vm : guest memory map (GPA).
Pure module: it holds the set of guest physical address ranges
reserved for a world (overlaps, alignment, quotas, page accounting)
without touching frames or translation tables. The kernel layer
(s9vm::vm) binds these ranges to pinned frames and second-level
tables.
It also owns the granularity plan used by that binding: a reservation
whose base is 2 MiB aligned and whose length is a multiple of 2 MiB is
split into 2 MiB leaves, while a partial head or tail stays on 4 KiB
pages. plan_map performs the split; the caller installs the segments
(2 MiB needs a 2 MiB-aligned, physically contiguous frame block).
Testable on the host (L2 tests).
Re-exports§
Structs§
- Guest
Map - Guest memory map of a world.
- MapPerms
- Permissions decoded from the ABI (1 = read, 2 = write, 4 = execute).
- MapSegment
- One contiguous piece of a guest mapping plan.
- Region
- Reserved range.
Enums§
Constants§
- LARGE_
PAGE_ FRAMES - Number of 4 KiB frames covered by one 2 MiB leaf.
- LARGE_
PAGE_ SIZE - Size of a large second-level page (2 MiB).
- MAX_GPA
- Maximum guest physical address width covered (48 bits).
- MAX_
REGIONS - Maximum number of distinct ranges per world (safety bound).
- PAGE_
SIZE - Size of a base page (4 KiB).
Functions§
- contiguous_
2m_ aligned - Checks that
hp_asis exactly the set of frames of one 2 MiB-aligned block. - perms_
from_ abi - Converts ABI permissions (1 = R, 2 = W, 4 = X; 0 = read) into
MapPerms. - plan_
map - Plans the 2 MiB/4 KiB split of
[gpa, gpa + len).