Skip to content

Commit b692fea

Browse files
committed
add docs
1 parent d8d5249 commit b692fea

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
edition = "2024"
33
name = "arm_vcpu"
44
version = "0.1.0"
5+
authors = [
6+
"KeYang Hu <keyang.hu@qq.com>",
7+
"Mingxian Su <aarkegz@gmail.com>",
8+
"ShiMei Tang <shimei820@gmail.com>",
9+
"DeBin Luo <luodeb@outlook.com>",
10+
"周睿 <zrufo747@outlook.com>"
11+
]
12+
description = "Aarch64 VCPU implementation for Arceos Hypervisor"
13+
license = "MIT OR Apache-2.0"
14+
repository = "https://github.com/arceos-hypervisor/arm_vcpu"
15+
categories = ["embedded", "no-std"]
16+
keywords = ["hypervisor", "aarch64", "vcpu"]
17+
518

619
[dependencies]
720
log = "0.4"

README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,68 @@
11
# arm_vcpu
22

33
[![CI](https://github.com/arceos-hypervisor/arm_vcpu/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/arceos-hypervisor/arm_vcpu/actions/workflows/ci.yml)
4+
[![Crates.io](https://img.shields.io/crates/v/arm_vcpu)](https://crates.io/crates/arm_vcpu)
5+
[![License](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)]
6+
7+
AArch64 virtual CPU (vCPU) implementation for hypervisors. This crate provides the core vCPU structure and virtualization-related interface support specifically designed for the AArch64 architecture.
8+
9+
## Features
10+
11+
- 🔧 **Complete vCPU Implementation**: Full virtual CPU structure for AArch64 guests
12+
- 🚀 **Exception Handling**: Comprehensive trap and exception handling for virtualized environments
13+
- 🎯 **Hardware Virtualization**: Support for ARMv8 virtualization extensions (EL2)
14+
- 🔒 **Security**: SMC (Secure Monitor Call) handling and secure virtualization
15+
- 📊 **Per-CPU Support**: Efficient per-CPU data structures and management
16+
- 🛠️ **No-std Compatible**: Works in bare-metal and embedded environments
17+
18+
## Architecture Overview
19+
20+
This crate implements the following key components:
21+
22+
- **`Aarch64VCpu`**: The main virtual CPU structure that manages guest execution state
23+
- **`TrapFrame`**: Context frame for handling traps and exceptions from guest VMs
24+
- **Exception Handlers**: Support for synchronous and asynchronous exception handling
25+
- **System Register Emulation**: Virtualized access to AArch64 system registers
26+
- **SMC Interface**: Secure Monitor Call handling for trusted execution
27+
28+
## Usage
29+
30+
Add this to your `Cargo.toml`:
31+
32+
```toml
33+
[dependencies]
34+
arm_vcpu = "0.1"
35+
```
36+
37+
### Basic Example
38+
39+
```rust
40+
use arm_vcpu::{Aarch64VCpu, Aarch64VCpuCreateConfig, has_hardware_support};
41+
42+
// Check if hardware virtualization is supported
43+
if has_hardware_support() {
44+
// Create vCPU configuration
45+
let config = Aarch64VCpuCreateConfig::default();
46+
47+
// Create and configure the virtual CPU
48+
let vcpu = Aarch64VCpu::new(config)?;
49+
50+
// Run the virtual CPU
51+
vcpu.run()?;
52+
}
53+
```
54+
55+
## Requirements
56+
57+
- **Architecture**: AArch64 (ARMv8-A or later)
58+
- **Privilege Level**: EL2 (Hypervisor mode) required for full functionality
59+
60+
## License
61+
62+
This project is dual-licensed under either:
63+
64+
- MIT License ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
65+
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
66+
67+
at your option.
468

5-
Definition of the vCPU structure and virtualization-related interface support for the AArch64 architecture.

0 commit comments

Comments
 (0)