Skip to main content

Crate axvcpu

Crate axvcpu 

Source
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§

AxPerCpu
Host per-CPU states to run the guest.
AxVCpu
Architecture-independent virtual CPU implementation.
AxVCpuInnerMut
Mutable runtime state of a virtual CPU.
GuestPhysAddr
Guest physical address.
MappingFlags
Generic page table entry flags that indicate the corresponding mapped memory region permissions and attributes.
NestedPageFaultInfo
Information about nested page faults.
Port
The port number of an I/O operation.
SysRegAddr
A system register address.

Enums§

AccessWidth
The width of an access.
AxVCpuExitReason
Reasons for VM-Exits returned by AxArchVCpu::run.
InterruptTriggerMode
Interrupt trigger mode.
VCpuState
Represents the current execution state of a virtual CPU.

Traits§

AxArchPerCpu
Trait representing the per-CPU architecture-specific virtualization state in a virtual machine.
AxArchVCpu
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§

HostPhysAddr
Host physical address.
VCpuId
Virtual CPU identifier within a VM.
VMId
Virtual machine identifier.