Activate Sv39 using linker-owned frames and prove kernel continuation (Batch 17) - #37
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ede082b945
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| count = fixed(headers["page_table_count"], "page_table_count") | ||
| if count == 0 or count > PAGES - 1 or len(rows) != count: raise RuntimeError("page-table count exceeds owned capacity") |
There was a problem hiding this comment.
Require exactly four page-table frames
If the builder begins consuming any count from one through seven, this verifier still returns PASS, even though the recipe's inherited_guarantees and the Batch 17 command contract specifically claim four page-table pages. A footprint or allocation regression to five pages would therefore be published as successful evidence instead of forcing the contract and resource budget to be reviewed; require count == 4 (and four rows) so this drift fails closed.
AGENTS.md reference: AGENTS.md:L92-L92
Useful? React with 👍 / 👎.
Motivation
Description
RealPageOwneradapter that allocates zeroed page-table pages from the existingPhysicalPageFrameAllocator, tracks ownership, and exposes checkedread/write/releaseoperations for the generic Sv39 builder to use. (recipes/run-hosted-morphic-runtime/src/freestanding_riscv64.zig)build.zig), extend the freestanding linker script with__image_begin, and update the Morphic recipe to document the new active-Sv39 steps. (build.zig,recipes/run-hosted-morphic-runtime/freestanding-riscv64.ld,recipes/run-hosted-morphic-runtime/recipe.json)satpwith Sv39 MODE/ASID=0/root PPN, execute the existing SFENCE.VMA privileged boundary, and record a deterministic evidence frame describing pool bounds, root/intermediate frames,satpbefore/after, alias sentinel observations, and continuation markers. (recipes/run-hosted-morphic-runtime/src/freestanding_riscv64.zig)tools/verify-freestanding-riscv64-active-sv39.pythat rejection-tests framing/field sets, decodes rawsatp, reconciles ELF symbols and pool bounds, validates owned page-table frames, verifies the non-identity alias, reuses Batch 12–16 parsers, and runs two bounded system-QEMU machines for real-machine proof. (tools/verify-freestanding-riscv64-active-sv39.py)COMMANDS.md,docs/reports/AGENTIC_SNOWBALL_BATCH_17.md)Testing
python3 tools/verify-freestanding-riscv64-physical-memory.py --self-testandpython3 tools/verify-freestanding-riscv64-physical-memory.py, which performed two realqemu-system-riscv64runs and passed the ELF pool, Baresatp, eight owned frames, sentinel read/write, exhaustion/release/double-free/reacquisition, and preserved prior Batch 12–15 evidence. (PASS)python3 tools/verify-freestanding-riscv64-active-sv39.py --self-testandpython3 tools/verify-freestanding-riscv64-active-sv39.py, which executed two realqemu-system-riscv64runs and validated thatsatpis Sv39 with owned root PPN, four owned page-table pages were used, the0x80400000 -> ownednon-identity alias observed the sentinel, SFENCE.VMA executed, and Morphic output remained identical across hosted/fake/two machines. (PASS)zig build test/smoketargets for the reused Sv39 modules andzig build test-recipe-construct-and-verify-sv39-address-spaceplus physical allocator tests, and they completed successfully (all focused tests passed). (PASS)PYTHONDONTWRITEBYTECODE=1 python3 tools/build-agent-index.py,python3 tools/check-command-reference.py --check,node tools/check-port-contracts.js,python3 tools/query-reference.py agent doctor, andpython3 tools/developer-command.py validate-repositoryto regenerate indexes and validate the repository; these verification steps passed after evidence regeneration. (PASS)All automated validation required by the Batch 17 plan ran to completion in this environment and returned passing results; no new interactive PR creation was performed because remote push/PR tooling was not available in this execution environment.
Codex Task