vmem: Add function for modifying mappings in-place - #1874
Conversation
This comment has been minimized.
This comment has been minimized.
This is useful for things like changing the permissions on an existing mapping. Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
e277b65 to
33a6193
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Both implementations allocate page tables for unmapped holes, risking guest scratch exhaustion.
Review effort: Balanced
Findings: 2
Open (5)
What changed in this PR
Adds in-place page-table mapping updates for guest memory permissions.
Changes:
- Exposes
modify_mappingthrough common and guest paging APIs. - Implements mapping updates for amd64 and AArch64.
- Reuses AArch64 descriptor decoding.
| File | Description |
|---|---|
src/hyperlight_guest_bin/src/paging.rs |
Re-exports the guest API. |
src/hyperlight_guest_bin/src/arch/amd64/paging.rs |
Adds the amd64 wrapper. |
src/hyperlight_guest_bin/src/arch/aarch64/paging.rs |
Adds the AArch64 wrapper. |
src/hyperlight_common/src/vmem.rs |
Documents and exports the common API. |
src/hyperlight_common/src/arch/amd64/vmem.rs |
Implements amd64 updates. |
src/hyperlight_common/src/arch/aarch64/vmem.rs |
Implements AArch64 updates and shares descriptor decoding. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Benchmark ResultsMeasured commit: kvm / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
kvm / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / amd (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / intel (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
Reported by |


This is useful for things like changing the permissions on an existing mapping.