Skip to content

Add page table mapping tests for aarch64 - #2121

Open
Anurag-S1ngh wants to merge 1 commit into
hyperlight-dev:mainfrom
Anurag-S1ngh:test/1131-aarch64-vmem-mapping-tests
Open

Anurag-S1ngh wants to merge 1 commit into
hyperlight-dev:mainfrom
Anurag-S1ngh:test/1131-aarch64-vmem-mapping-tests

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown

Summary

The aarch64 page table implementation had no tests, while the amd64 one has a suite covering map, virt_to_phys, modify_mapping and modify_ptes. This adds an in-memory mock TableOps for aarch64 and mirrors that coverage, including COW and zero-init mappings.

Changes

  • Added a tests module to src/hyperlight_common/src/arch/aarch64/vmem.rs.
  • Covers single and multi-page mappings, table reuse, physical and permission encoding, COW and zero-init descriptors, unmapped ranges, modify_mapping (downgrade and unmap), modify_ptes iteration, and address roundtrips.

Testing

  • cargo test -p hyperlight-common --lib (389 tests pass on aarch64 macOS)
  • cargo clippy -p hyperlight-common --all-targets
  • cargo fmt -p hyperlight-common -- --check

Closes #1131

The amd64 page table code had unit tests for map(), virt_to_phys()
and modify_mapping(), but the aarch64 implementation had none. Add a
mock TableOps and mirror those tests, plus coverage for COW and
zero-init mappings.

Signed-off-by: Anurag Singh <anuragsingh2313@gmail.com>
@Anurag-S1ngh
Anurag-S1ngh force-pushed the test/1131-aarch64-vmem-mapping-tests branch from 8cf63c2 to 2d7b6cc Compare November 29, 2026 08:10

This branch has not been deployed

No deployments
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.

Implement Additional tests for Guest Mapping

1 participant