pub fn run_vcpu(vcpu_id: u64, caps: &HwCaps) -> Result<(), RunError>Expand description
Runs a vCPU until the next “policy” exit and queues the corresponding event in the world’s queue.
Exits that are purely hostile to throughput (external interrupt, interrupt window, APIC, preemption timer) are resumed immediately by the kernel; all the others are reported back to policy.
§Timing
Every guest entry is bracketed by two time-stamp counter reads. The delta is recorded in the world’s cumulative timing aggregates, per exit class: the decoded reason for exits that reach policy, the functional class for exits replayed by the kernel. Because the pair spans the guest entry and the exit delivery, the delta measures the entry/exit cost on the CPU that runs the vCPU only for single-instruction exits (I/O port, MSR access, second-level violation), where the guest time is negligible; for asynchronous exits (external interrupt, preemption timer, halt) it also contains the guest time slice that preceded the exit, and must not be read as the exit latency. Device-model replay latency is measured separately around the replay.
The sliding window of the rate meters is advanced once per call: one call is one time slice.