Skip to main content

AxArchPerCpu

Trait AxArchPerCpu 

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

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

Trait representing the per-CPU architecture-specific virtualization state in a virtual machine.

This trait defines the required methods to manage and interact with the virtualization state on a per-CPU basis. Implementers of this trait should handle the specifics of how hardware virtualization is enabled, disabled, and checked for each CPU in the system.

Required Methods§

Source

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

Create a new per-CPU state.

Source

fn is_enabled(&self) -> bool

Whether hardware virtualization is enabled on the current CPU.

Source

fn hardware_enable(&mut self) -> AxResult

Enable hardware virtualization on the current CPU.

Source

fn hardware_disable(&mut self) -> AxResult

Disable hardware virtualization on the current CPU.

Provided Methods§

Source

fn max_guest_page_table_levels(&self) -> usize

Return max guest page table levels used by the architecture.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§