Expand description
AxVCpu - Virtual CPU abstraction for ArceOS hypervisors.
This crate provides a unified, architecture-independent interface for managing virtual CPUs
in hypervisor environments. It delegates architecture-specific operations to implementations
of the AxArchVCpu trait while providing common functionality like state management,
CPU binding, and execution control.
§Features
- Architecture-agnostic virtual CPU management
- State machine for VCpu lifecycle (Created → Free → Ready → Running)
- Per-CPU virtualization state management
- Hardware abstraction layer for hypervisor operations
- Support for interrupt injection and register manipulation
Structs§
- AxPer
Cpu - Host per-CPU states to run the guest.
- AxVCpu
- Architecture-independent virtual CPU implementation.
- AxVCpu
Inner Mut - Mutable runtime state of a virtual CPU.
- Guest
Phys Addr - Guest physical address.
- Mapping
Flags - Generic page table entry flags that indicate the corresponding mapped memory region permissions and attributes.
- Nested
Page Fault Info - Information about nested page faults.
- Port
- The port number of an I/O operation.
- SysReg
Addr - A system register address.
Enums§
- Access
Width - The width of an access.
- AxVCpu
Exit Reason - Reasons for VM-Exits returned by AxArchVCpu::run.
- Interrupt
Trigger Mode - Interrupt trigger mode.
- VCpu
State - Represents the current execution state of a virtual CPU.
Traits§
- AxArch
PerCpu - Trait representing the per-CPU architecture-specific virtualization state in a virtual machine.
- AxArchV
Cpu - Architecture-specific virtual CPU trait definition.
Functions§
- clear_
current_ ⚠vcpu - Clear the current vcpu on the current physical CPU.
- get_
current_ vcpu - Get the current VCpu on the current physical CPU.
- get_
current_ vcpu_ mut - Get a mutable reference to the current VCpu on the current physical CPU.
- set_
current_ ⚠vcpu - Set the current VCpu on the current physical CPU.
Type Aliases§
- Host
Phys Addr - Host physical address.
- VCpuId
- Virtual CPU identifier within a VM.
- VMId
- Virtual machine identifier.