-
Notifications
You must be signed in to change notification settings - Fork 12
update readme/toolchain/cargo... #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,20 @@ | |
| name = "riscv_vcpu" | ||
| version = "0.1.0" | ||
| edition = "2024" | ||
| authors = [ | ||
| "KeYang Hu <[email protected]>", | ||
| "Mingxian Su <[email protected]>", | ||
| "Peizhong Qiu <[email protected]>", | ||
| "周睿 <[email protected]>" | ||
| ] | ||
| description = "ArceOS-Hypervisor riscv vcpu module" | ||
| license = "MIT OR Apache-2.0" | ||
| repository = "https://github.com/arceos-hypervisor/riscv_vcpu" | ||
| categories = ["embedded", "no-std"] | ||
| keywords = ["hypervisor", "riscv", "vcpu"] | ||
|
|
||
| [dependencies] | ||
| log = "0.4.19" | ||
| log = "0.4" | ||
| cfg-if = "1.0" | ||
| bitflags = "2.2" | ||
| bit_field = "0.10" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,60 @@ | ||
| # riscv_vcpu | ||
| # **riscv_vcpu** | ||
|
|
||
| riscv64 virtual CPU (vCPU) implementation for hypervisors. This crate provides the core vCPU structure and virtualization-related interface support specifically designed for the riscv64 architecture. | ||
|
|
||
| [](https://github.com/arceos-hypervisor/riscv_vcpu/actions/workflows/ci.yml) | ||
| [] | ||
|
|
||
| ## Overview | ||
|
|
||
| riscv_vcpu implements a minimal RISC-V Virtual CPU (VCPU) abstraction layer compliant with the RISC-V Hypervisor Extension (RVH). Designed for embedded hypervisors and educational use, it can operates in no_std environments. | ||
|
|
||
| ## Features | ||
|
|
||
| - **Complete vCPU Implementation**: Full virtual CPU structure for riscv64 guests | ||
| - **Exception Handling**: Comprehensive trap and exception handling for virtualized environments | ||
| - **EPT (Extended Page Tables)**: Memory virtualization support | ||
| - **VMCS Management**: Virtual Machine Control Structure operations | ||
| - **Per-CPU Support**: Efficient per-CPU data structures and management | ||
| - **No-std Compatible**: Works in bare-metal and embedded environments | ||
|
|
||
| ## Usage | ||
|
|
||
| Add this to your `Cargo.toml`: | ||
|
|
||
| ```toml | ||
| [dependencies] | ||
| riscv_vcpu = "0.1" | ||
| ``` | ||
|
|
||
| ## Basic Usage | ||
|
|
||
| ```rust | ||
| use riscv_vcpu::{RISCVVCpu, RISCVVCpuCreateConfig, has_hardware_support}; | ||
|
|
||
| // Check if hardware virtualization is supported | ||
| if has_hardware_support() { | ||
| // Create vCPU configuration | ||
| let config = RISCVVCpuCreateConfig::default(); | ||
|
|
||
| // Create and configure the virtual CPU | ||
| let vcpu = RISCVVCpu::new(config)?; | ||
|
|
||
| // Run the virtual CPU | ||
| vcpu.run()?; | ||
| } | ||
| ``` | ||
|
|
||
| ## Related Projects | ||
|
|
||
| + [ArceOS](https://github.com/arceos-org/arceos) - An experimental modular OS (or Unikernel) | ||
| + [AxVisor](https://github.com/arceos-hypervisor/axvisor) - Hypervisor implementation | ||
|
|
||
| ## License | ||
|
|
||
| This project is dual-licensed under either: | ||
|
|
||
| - MIT License ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>) | ||
| - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>) | ||
|
|
||
| Definition of the vCPU structure and virtualization-related interface support for the AArch64 architecture. | ||
| at your option. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [toolchain] | ||
| channel = "nightly-2025-05-20" | ||
| components = ["rust-src", "llvm-tools", "rustfmt", "clippy"] | ||
| profile = "minimal" | ||
| targets = [ | ||
| "riscv64gc-unknown-none-elf", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.