Skip to main content

VmArchPerCpuOps

Trait VmArchPerCpuOps 

Source
pub trait VmArchPerCpuOps: Sized {
    // Required methods
    fn new(cpu_id: usize) -> VmBackendResult<Self>;
    fn is_enabled(&self) -> bool;
    fn hardware_enable(&mut self) -> VmBackendResult;
    fn hardware_disable(&mut self) -> VmBackendResult;

    // Provided methods
    fn max_guest_page_table_levels(&self) -> usize { ... }
    fn guest_phys_addr_bits(&self) -> usize { ... }
}
Expand description

Architecture-specific per-CPU virtualization state consumed by AxVM.

Required Methods§

Source

fn new(cpu_id: usize) -> VmBackendResult<Self>

Creates a new per-CPU state.

Source

fn is_enabled(&self) -> bool

Whether virtualization is enabled on the current CPU.

Source

fn hardware_enable(&mut self) -> VmBackendResult

Enables virtualization on the current CPU.

Source

fn hardware_disable(&mut self) -> VmBackendResult

Disables virtualization on the current CPU.

Provided Methods§

Source

fn max_guest_page_table_levels(&self) -> usize

Returns the max guest page table levels supported by this architecture.

Source

fn guest_phys_addr_bits(&self) -> usize

Returns the guest physical address width supported by this CPU.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§