Expand description
x86_vcpu
x86 vCPU implementation for the ArceOS Hypervisor
English | 中文
§Introduction
x86_vcpu provides x86 vCPU implementation for the ArceOS Hypervisor. It is maintained as part of the TGOSKits component set and is intended for Rust projects that integrate with ArceOS, AxVisor, or related low-level systems software.
§Quick Start
§Installation
Add this crate to your Cargo.toml:
[dependencies]
x86_vcpu = "0.5.0"§Run Check and Test
# Enter the crate directory
cd virtualization/x86_vcpu
# Format code
cargo fmt --all
# Run clippy
cargo clippy --all-targets --all-features
# Run tests
cargo test --all-features
# Build documentation
cargo doc --no-deps§Integration
§Example
use x86_vcpu as _;
fn main() {
// Integrate `x86_vcpu` into your project here.
}§Documentation
Generate and view API documentation:
cargo doc --no-deps --openOnline documentation: docs.rs/x86_vcpu
§Contributing
- Fork the repository and create a branch
- Run local format and checks
- Run local tests relevant to this crate
- Submit a PR and ensure CI passes
§License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Re-exports§
pub use host::X86HostOps;
Modules§
- host
- Host callbacks required by the OS-neutral x86 vCPU implementation.
Structs§
- General
Registers - General-purpose registers for the 64-bit x86 architecture.
- Guest
Page Walk Info - The information of guest page walk.
- X86Access
Flags - Access flags reported for a nested page fault.
- X86Byte
Register - Byte register selected by a ModRM.reg field for byte MOV instructions.
- X86Guest
Memory Region - Guest RAM region backing for x86 vCPU helpers.
- X86Guest
Phys Addr - X86Guest
Virt Addr - X86Host
Phys Addr - X86Host
Virt Addr - X86Intercepted
Mmio Range - Guest MMIO range that should trap and be routed through the VMM’s resolved device runtime instead of the stage-2 page-fault path.
- X86Intercepted
Port Range - Guest I/O port range that should trap and be handled by the VMM.
- X86Msr
Addr - x86 MSR address.
- X86Nested
Page Fault Info - Information about a nested guest page-table fault.
- X86Nested
Paging Config - Nested page table configuration selected by the embedding VMM.
- X86Per
CpuState - Runtime-dispatched x86 per-CPU virtualization state.
- X86Port
- The port number of an x86 I/O operation.
- X86Port
IoString Exit - One element of a trapped
(REP) INS/OUTSinstruction. - X86Vcpu
- Runtime-dispatched x86 virtual CPU.
- X86Vcpu
Create Config - x86 vCPU creation configuration.
- X86Vcpu
Setup Config - x86 vCPU setup configuration.
Enums§
- X86Access
Width - Width of a trapped guest bus access.
- X86Nested
Paging Format - Guest-physical nested-paging formats supported by x86 hardware backends.
- X86Port
IoDirection - Direction of a string port-I/O instruction.
- X86Vcpu
Error - Errors produced by the OS-neutral x86 vCPU core.
- X86Vm
Exit - VM-exit reason returned by the x86 vCPU core.
Constants§
- X86_
LOCAL_ APIC_ GPA - Guest physical base address of the architectural local APIC window.
- X86_
LOCAL_ APIC_ SIZE - Size of the architectural local APIC window.
- X86_
MAX_ INTERCEPTED_ PORT_ RANGES - Maximum number of guest I/O port ranges trapped for one vCPU.
Functions§
- apic_
access_ page_ addr - Return the host page that backs the APIC-access page.
- apic_
access_ page_ gpa - Return the guest physical address reserved for the APIC-access page.
- has_
hardware_ support - Return whether the current CPU exposes exactly one supported virtualization extension.
- initialize_
hardware_ support - Detect and freeze the x86 backend used by this AxVM runtime.
- requires_
apic_ access_ page - Return whether the selected backend needs an APIC-access backing page.
- selected_
nested_ paging_ format - Return the nested-paging format selected during initialization.
Type Aliases§
- X86Vcpu
Result - Result type returned by the OS-neutral x86 vCPU core.