English | 中文
Introduction
axaddrspace is the guest address space management crate for the
ArceOS-Hypervisor project. It provides
nested page table management, guest physical address translation, memory
mapping backends, and nested page fault handling for hypervisor environments.
This crate supports multiple architectures:
- x86_64 - VMX Extended Page Tables (EPT)
- AArch64 - Stage-2 page tables
- RISC-V - Nested page tables based on the hypervisor extension
Key capabilities include:
AddrSpace- address space creation, mapping, unmapping, and translationAxMmHal- hardware abstraction trait for frame allocation and address conversion- Linear mapping backend - map known contiguous host physical memory ranges
- Allocation mapping backend - allocate frames eagerly or lazily on page faults
- Guest memory helpers - translate guest addresses to accessible host buffers
Supports #![no_std] and is intended for bare-metal hypervisor and kernel use.
Quick Start
Requirements
- Rust nightly toolchain
- Rust components:
rust-src,clippy,rustfmt
# Install rustup (if not installed)
|
# Install nightly toolchain and components
Run Check and Test
# 1. Clone the repository
# 2. Code check
# 3. Run tests
# 4. Run a specific integration test target directly
The helper scripts download the shared axci test/check framework on first run.
Integration
Installation
Add to your Cargo.toml:
[]
= "0.3.0"
Example
use ;
use ;
use PagingHandler;
;
Features
arm-el2: enable AArch64 EL2 supportdefault: includesarm-el2
Documentation
Generate and view API documentation:
Online documentation: docs.rs/axaddrspace
Contributing
- Fork the repository and create a branch
- Run local check:
./scripts/check.sh - Run local tests:
./scripts/test.sh - Submit PR and pass CI checks
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.