Skip to content

docs: fix memory-map table to show infra reserve at top of IPA#79

Merged
jserv merged 1 commit into
sysprog21:mainfrom
Max042004:docs-memory-map
Jun 6, 2026
Merged

docs: fix memory-map table to show infra reserve at top of IPA#79
jserv merged 1 commit into
sysprog21:mainfrom
Max042004:docs-memory-map

Conversation

@Max042004
Copy link
Copy Markdown
Collaborator

@Max042004 Max042004 commented Jun 6, 2026

Summary

The Memory Layout table in docs/internals.md showed the page-table pool, shim code, and shim data at low addresses (0x100000x3FFFFF) — a legacy layout. The code (compute_infra_layout in src/core/guest.c) anchors the infrastructure reserve at [interp_base - INFRA_RESERVE, interp_base), in the dead zone above mmap_limit, so EL0 binaries are free to load at low addresses without colliding with the runtime.

This is the doc-cleanup follow-up @jserv flagged on #75 ("carries a pre-existing memory-map table showing a legacy layout with the infra reserve at LOW addresses; the actual code places it at the top of IPA. Worth a separate doc-cleanup PR"), kept out of #75 as requested.

Changes

  • Split the table into low fixed addresses (ELF, brk, stack, mmap) and the interp_base-anchored high reserve.
  • Describe the reserve's internal layout (null guard, page-table pool, shim code sharing the pool's tail 2 MiB L2 block, shim data) to match src/core/guest.h.
  • Note the reserve is demand-paged (MAP_ANON) so the reservation costs no host RAM.

Ordering

Numbers reflect the grown 16 MiB reserve / ~13.9 MiB pool from #75, not current main (4 MiB / 960 KiB). This PR should land together with or after #75; the two touch different files (#75guest.h/main.c, this → internals.md), so no merge conflict.

Docs-only; no code change.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

The Memory Layout table in internals.md showed the page-table pool, shim
code, and shim data at low addresses (0x10000-0x3FFFFF), a legacy layout.
The code (compute_infra_layout in src/core/guest.c) anchors the infra
reserve at [interp_base - INFRA_RESERVE, interp_base), in the dead zone
above mmap_limit, so EL0 binaries are free to load at low addresses without
colliding with the runtime.

Rewrite the table to split low fixed addresses from the interp_base-anchored
high reserve, and describe the reserve's internal layout (null guard, page
table pool, shim code sharing the pool's tail 2 MiB block, shim data) to
match src/core/guest.h. Numbers reflect the grown 16 MiB reserve / ~13.9 MiB
pool from sysprog21#75; this doc PR should land together with or after that change.
@jserv jserv merged commit 43f4763 into sysprog21:main Jun 6, 2026
@jserv
Copy link
Copy Markdown
Contributor

jserv commented Jun 6, 2026

Thank @Max042004 for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants