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§
Sourcefn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Whether hardware virtualization is enabled on the current CPU.
Sourcefn hardware_enable(&mut self) -> AxResult
fn hardware_enable(&mut self) -> AxResult
Enable hardware virtualization on the current CPU.
Sourcefn hardware_disable(&mut self) -> AxResult
fn hardware_disable(&mut self) -> AxResult
Disable hardware virtualization on the current CPU.
Provided Methods§
Sourcefn max_guest_page_table_levels(&self) -> usize
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.