Skip to main content

VcpuSlot

Struct VcpuSlot 

Source
pub struct VcpuSlot {
Show 17 fields pub id: u64, pub apic_id: u32, pub regs: VmmRegs, hardware: Option<HwVcpu>, apic: LocalApic, pending_nmi: bool, task: Option<TaskId>, run_requested: bool, run_in_flight: bool, run_done: bool, in_guest: bool, runs: u64, run_result: Option<Result<(), RunError>>, shutdown: bool, exited: bool, run_wait: Arc<WaitQueue>, done_wait: Arc<WaitQueue>,
}
Expand description

Logical vCPU: opaque identifier, APIC id and ABI register block.

The hardware context (control block, host stack, guest state) is created at execution time, not at logical creation time: a world can be configured (memory, vCPUs, registers) before the hardware is activated.

ADR-4 model: each vCPU is driven by a dedicated kernel task (VcpuSlot::task). The task waits for a RUN request, runs the guest until the next policy exit, queues the event, then waits again. The kernel thus guarantees that a guest never runs on the syscall caller’s stack.

Fields§

§id: u64

Opaque identifier of the vCPU.

§apic_id: u32

Guest APIC identifier.

§regs: VmmRegs

ABI register block.

§hardware: Option<HwVcpu>

Hardware context (created on the first RUN).

§apic: LocalApic

Guest local APIC (architectural state, MMIO page and x2APIC MSR).

§pending_nmi: bool

NMI pending injection at the next RUN.

§task: Option<TaskId>

Kernel task driving this vCPU (created with the vCPU).

§run_requested: bool

A RUN has been requested and has not been taken into account yet.

§run_in_flight: bool

A RUN is in flight: a single caller at a time.

§run_done: bool

The last requested RUN is finished.

§in_guest: bool

The vCPU task is currently inside execute_one_run (guest mode).

§runs: u64

Number of RUNs executed by this vCPU task.

§run_result: Option<Result<(), RunError>>

Result of the last RUN (valid when run_done).

§shutdown: bool

Shutdown requested (vCPU or world destruction).

§exited: bool

The kernel task has finished and its hardware resources are unloaded.

§run_wait: Arc<WaitQueue>

Wake-up of the vCPU task on a RUN request (or shutdown).

§done_wait: Arc<WaitQueue>

Wake-up of callers blocked on the end of a RUN or on a shutdown.

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.