English | 中文
Introduction
arm_vcpu provides an AArch64 virtual CPU implementation for the ArceOS Hypervisor stack. It focuses on EL2-based virtualization on ARMv8-A platforms and offers the core data structures and handlers needed to create, configure, and run guest vCPUs in #![no_std] environments.
This crate exports the following core types:
Aarch64VCpu— the main AArch64 vCPU implementationAarch64VCpuCreateConfig— configuration used when creating a vCPUAarch64VCpuSetupConfig— runtime setup options such as interrupt and timer passthroughAarch64PerCpu— per-CPU support for the AArch64 virtualization environmentTrapFrame— guest trap context frame used during exception handling
It also provides has_hardware_support() to query whether the current platform supports the required virtualization capability.
Quick Start
Requirements
- AArch64 platform
- EL2 (Hypervisor mode) support
- 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 (format + clippy + build + doc generation)
# 3. Run tests
# Run all tests (unit tests + integration tests)
# Run unit tests only
# Run integration tests only
# List all available test suites
# Restrict target selection
Integration
Installation
Add to your Cargo.toml:
[]
= "0.3.0"
Example
use ;
use ;
use AxArchVCpu;
Documentation
Generate and view API documentation:
Online documentation: docs.rs/arm_vcpu
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.