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.

Enums§

AxVCpuExitReason
Reasons for VM-Exits returned by AxArchVCpu::run.
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.
AxVCpuHal
Hardware abstraction layer interfaces for VCpu operations.

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.