Skip to main content

VmExit

Enum VmExit 

Source
#[non_exhaustive]
pub enum VmExit {
Show 19 variants Hypercall { nr: u64, args: [u64; 6], }, MmioRead { addr: GuestPhysAddr, width: AccessWidth, reg: usize, reg_width: AccessWidth, signed_ext: bool, }, MmioWrite { addr: GuestPhysAddr, width: AccessWidth, data: u64, }, SysRegRead { addr: SysRegAddr, reg: usize, }, SysRegWrite { addr: SysRegAddr, value: u64, }, IoRead { port: Port, width: AccessWidth, }, IoWrite { port: Port, width: AccessWidth, data: u64, }, ExternalInterrupt { vector: u64, }, NestedPageFault { addr: GuestPhysAddr, access_flags: MappingFlags, }, Halt, Idle, CpuUp { target_cpu: u64, entry_point: GuestPhysAddr, arg: u64, }, CpuDown { _state: u64, }, SystemDown, Nothing, PreemptionTimer, InterruptEnd { vector: Option<u8>, }, FailEntry { hardware_entry_failure_reason: u64, }, SendIPI { target_cpu: u64, target_cpu_aux: u64, send_to_all: bool, send_to_self: bool, vector: u64, },
}
Expand description

Legacy/common normalized VM event.

New AxVM architecture backends should expose their raw VM-exit type through VmArchVcpuOps::Exit and handle it inside their axvm::arch module. This enum remains for compatibility and as a transitional normalized event shape for backends that have not split out an architecture-owned exit enum.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Hypercall

A guest instruction triggered a hypercall to the hypervisor.

Fields

§nr: u64

Hypercall number.

§args: [u64; 6]

Hypercall arguments.

§

MmioRead

The guest performed an MMIO read.

Fields

§addr: GuestPhysAddr

Guest physical address being read.

§width: AccessWidth

Access width.

§reg: usize

Destination guest register.

§reg_width: AccessWidth

Destination register width.

§signed_ext: bool

Whether the value should be sign-extended.

§

MmioWrite

The guest performed an MMIO write.

Fields

§addr: GuestPhysAddr

Guest physical address being written.

§width: AccessWidth

Access width.

§data: u64

Value written by the guest.

§

SysRegRead

The guest performed a system register read.

Fields

§addr: SysRegAddr

System register address.

§reg: usize

Destination guest register.

§

SysRegWrite

The guest performed a system register write.

Fields

§addr: SysRegAddr

System register address.

§value: u64

Value written by the guest.

§

IoRead

The guest performed an x86 port I/O read.

Fields

§port: Port

Port number.

§width: AccessWidth

Access width.

§

IoWrite

The guest performed an x86 port I/O write.

Fields

§port: Port

Port number.

§width: AccessWidth

Access width.

§data: u64

Value written by the guest.

§

ExternalInterrupt

An external interrupt was delivered to the vCPU.

Fields

§vector: u64

Interrupt vector number.

§

NestedPageFault

A nested page fault occurred during guest execution.

Fields

§addr: GuestPhysAddr

Guest physical address that caused the fault.

§access_flags: MappingFlags

Access type that caused the fault.

§

Halt

The guest halted.

§

Idle

The guest reached an idle instruction.

§

CpuUp

The guest requested secondary CPU startup.

Fields

§target_cpu: u64

Target CPU identifier in the architecture namespace.

§entry_point: GuestPhysAddr

Secondary entry point.

§arg: u64

Secondary boot argument.

§

CpuDown

The guest powered down one vCPU.

Fields

§_state: u64

Architecture power-state payload.

§

SystemDown

The guest requested VM shutdown.

§

Nothing

No VMM action is required.

§

PreemptionTimer

Hardware virtualization preemption timer expired.

§

InterruptEnd

The guest completed interrupt service with EOI.

Fields

§vector: Option<u8>

EOI vector, when available.

§

FailEntry

VM entry failed.

Fields

§hardware_entry_failure_reason: u64

Architecture-specific failure code.

§

SendIPI

The guest requested an IPI.

Fields

§target_cpu: u64

Target CPU identifier in the architecture namespace.

§target_cpu_aux: u64

Auxiliary target selector.

§send_to_all: bool

Whether to broadcast to all CPUs except the sender.

§send_to_self: bool

Whether to target the current vCPU.

§vector: u64

IPI vector.

Trait Implementations§

Source§

impl Debug for VmExit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.