Skip to main content

Crate x86_vcpu

Crate x86_vcpu 

Source
Expand description

x86_vcpu

x86 vCPU implementation for the ArceOS Hypervisor

Crates.io Docs.rs Rust License

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 --open

Online documentation: docs.rs/x86_vcpu

§Contributing

  1. Fork the repository and create a branch
  2. Run local format and checks
  3. Run local tests relevant to this crate
  4. 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§

GeneralRegisters
General-purpose registers for the 64-bit x86 architecture.
GuestPageWalkInfo
The information of guest page walk.
X86AccessFlags
Access flags reported for a nested page fault.
X86ByteRegister
Byte register selected by a ModRM.reg field for byte MOV instructions.
X86GuestMemoryRegion
Guest RAM region backing for x86 vCPU helpers.
X86GuestPhysAddr
X86GuestVirtAddr
X86HostPhysAddr
X86HostVirtAddr
X86InterceptedMmioRange
Guest MMIO range that should trap and be routed through the VMM’s resolved device runtime instead of the stage-2 page-fault path.
X86InterceptedPortRange
Guest I/O port range that should trap and be handled by the VMM.
X86MsrAddr
x86 MSR address.
X86NestedPageFaultInfo
Information about a nested guest page-table fault.
X86NestedPagingConfig
Nested page table configuration selected by the embedding VMM.
X86PerCpuState
Runtime-dispatched x86 per-CPU virtualization state.
X86Port
The port number of an x86 I/O operation.
X86PortIoStringExit
One element of a trapped (REP) INS/OUTS instruction.
X86Vcpu
Runtime-dispatched x86 virtual CPU.
X86VcpuCreateConfig
x86 vCPU creation configuration.
X86VcpuSetupConfig
x86 vCPU setup configuration.

Enums§

X86AccessWidth
Width of a trapped guest bus access.
X86NestedPagingFormat
Guest-physical nested-paging formats supported by x86 hardware backends.
X86PortIoDirection
Direction of a string port-I/O instruction.
X86VcpuError
Errors produced by the OS-neutral x86 vCPU core.
X86VmExit
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§

X86VcpuResult
Result type returned by the OS-neutral x86 vCPU core.