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: u64Opaque identifier of the vCPU.
apic_id: u32Guest APIC identifier.
regs: VmmRegsABI register block.
hardware: Option<HwVcpu>Hardware context (created on the first RUN).
apic: LocalApicGuest local APIC (architectural state, MMIO page and x2APIC MSR).
pending_nmi: boolNMI pending injection at the next RUN.
task: Option<TaskId>Kernel task driving this vCPU (created with the vCPU).
run_requested: boolA RUN has been requested and has not been taken into account yet.
run_in_flight: boolA RUN is in flight: a single caller at a time.
run_done: boolThe last requested RUN is finished.
in_guest: boolThe vCPU task is currently inside execute_one_run (guest mode).
runs: u64Number of RUNs executed by this vCPU task.
run_result: Option<Result<(), RunError>>Result of the last RUN (valid when run_done).
shutdown: boolShutdown requested (vCPU or world destruction).
exited: boolThe 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§
impl !RefUnwindSafe for VcpuSlot
impl !UnwindSafe for VcpuSlot
impl Forget for VcpuSlot
impl Freeze for VcpuSlot
impl Move for VcpuSlot
impl Send for VcpuSlot
impl Sync for VcpuSlot
impl Unpin for VcpuSlot
impl UnsafeUnpin for VcpuSlot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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