pub trait VmArchVcpuOps: Sized {
type CreateConfig;
type SetupConfig;
type Exit: Debug;
Show 13 methods
// Required methods
fn new(
vm_id: VMId,
vcpu_id: VCpuId,
config: Self::CreateConfig,
) -> AxVmResult<Self>;
fn set_entry(&mut self, entry: GuestPhysAddr) -> AxVmResult;
fn set_nested_page_table(
&mut self,
config: NestedPagingConfig,
) -> AxVmResult;
fn setup(&mut self, config: Self::SetupConfig) -> AxVmResult;
fn run(&mut self) -> AxVmResult<Self::Exit>;
fn bind(&mut self) -> AxVmResult;
fn unbind(&mut self) -> AxVmResult;
fn set_gpr(&mut self, reg: usize, val: usize);
fn inject_interrupt(&mut self, vector: usize) -> AxVmResult;
fn set_return_value(&mut self, val: usize);
// Provided methods
fn decode_mmio_fault(
&mut self,
_fault_addr: GuestPhysAddr,
_access_flags: MappingFlags,
) -> Option<VmExit> { ... }
fn inject_interrupt_with_trigger(
&mut self,
vector: usize,
trigger: InterruptTriggerMode,
) -> AxVmResult { ... }
fn handle_eoi(&mut self) -> Option<u8> { ... }
}Expand description
Architecture-specific vCPU operations consumed by AxVM.
Required Associated Types§
Sourcetype CreateConfig
type CreateConfig
Architecture-specific creation configuration.
Sourcetype SetupConfig
type SetupConfig
Architecture-specific setup configuration.
Required Methods§
Sourcefn new(
vm_id: VMId,
vcpu_id: VCpuId,
config: Self::CreateConfig,
) -> AxVmResult<Self>
fn new( vm_id: VMId, vcpu_id: VCpuId, config: Self::CreateConfig, ) -> AxVmResult<Self>
Creates a new architecture-specific vCPU.
Sourcefn set_entry(&mut self, entry: GuestPhysAddr) -> AxVmResult
fn set_entry(&mut self, entry: GuestPhysAddr) -> AxVmResult
Sets the guest entry point.
Sourcefn set_nested_page_table(&mut self, config: NestedPagingConfig) -> AxVmResult
fn set_nested_page_table(&mut self, config: NestedPagingConfig) -> AxVmResult
Sets the nested page table selected by AxVM.
Sourcefn setup(&mut self, config: Self::SetupConfig) -> AxVmResult
fn setup(&mut self, config: Self::SetupConfig) -> AxVmResult
Completes architecture-specific setup.
Sourcefn run(&mut self) -> AxVmResult<Self::Exit>
fn run(&mut self) -> AxVmResult<Self::Exit>
Runs the vCPU until an architecture-specific VM exit.
Sourcefn bind(&mut self) -> AxVmResult
fn bind(&mut self) -> AxVmResult
Binds the vCPU to the current physical CPU.
Sourcefn unbind(&mut self) -> AxVmResult
fn unbind(&mut self) -> AxVmResult
Unbinds the vCPU from the current physical CPU.
Sourcefn inject_interrupt(&mut self, vector: usize) -> AxVmResult
fn inject_interrupt(&mut self, vector: usize) -> AxVmResult
Injects an interrupt into the vCPU.
Sourcefn set_return_value(&mut self, val: usize)
fn set_return_value(&mut self, val: usize)
Sets the guest return value.
Provided Methods§
Sourcefn decode_mmio_fault(
&mut self,
_fault_addr: GuestPhysAddr,
_access_flags: MappingFlags,
) -> Option<VmExit>
fn decode_mmio_fault( &mut self, _fault_addr: GuestPhysAddr, _access_flags: MappingFlags, ) -> Option<VmExit>
Decodes an architecture-specific memory fault as a legacy normalized MMIO event when possible.
This is kept as a transition helper for backends that still route
device faults through VmExit. New raw vCPU exits should use
Self::Exit and be handled in the architecture-local AxVM adapter.
Sourcefn inject_interrupt_with_trigger(
&mut self,
vector: usize,
trigger: InterruptTriggerMode,
) -> AxVmResult
fn inject_interrupt_with_trigger( &mut self, vector: usize, trigger: InterruptTriggerMode, ) -> AxVmResult
Injects an interrupt with trigger-mode metadata.
Sourcefn handle_eoi(&mut self) -> Option<u8>
fn handle_eoi(&mut self) -> Option<u8>
Processes a guest EOI and returns an external EOI vector when needed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".