src/vmm/src/linux/vstate.rs — hypervisor execution loop and VM exit handling
VcpuExit::MmioRead/Write → MMIODeviceManager.dispatch_mmio(addr, data) → Bus.get_device(addr) bus.rs:103 → MmioTransport.read/write() mmio.rs:377 → device register access.MmioTransport::write(QUEUE_NOTIFY) → queue_evts[n].write(1) → EventManager wakes → device processes descriptors queue.rs:452 → marks used → interrupt_evt.write(1) → inject IRQ into vCPU.
VcpuExit::SystemEvent vstate.rs:1532. The VMM sends a shutdown signal to all other vCPU threads.
KVM_RUN, processes pending events (injected IRQs, device work), then re-enters the guest.
| Exit reason | What happened | Handler action |
|---|---|---|
| KVM_EXIT_MMIO :1502 | Guest accessed a guest-physical address outside RAM | Route to MmioTransport via Bus; complete read/write; resume |
| KVM_EXIT_IO :1471 | Guest executed IN/OUT port instruction (x86-64 only) | Route to legacy I/O bus (serial, CMOS, i8042); resume |
| KVM_EXIT_INTR | KVM_RUN interrupted by a signal to the vCPU thread | Check for pending work; re-enter KVM_RUN |
| KVM_EXIT_HLT :1514 | Guest executed HLT (x86) with no pending IRQ | Wait for interrupt kick before resuming |
| KVM_EXIT_SHUTDOWN :1518 | Guest triple-faulted or issued shutdown (e.g. ACPI off) | Signal all vCPU threads to stop; EventManager exits |
| KVM_EXIT_SYSTEM_EVENT :1532 | Guest issued PSCI reboot/poweroff (ARM) | Parse event type; trigger VM shutdown or reset |
| KVM_EXIT_FAIL_ENTRY :1524 | vCPU could not enter the guest (bad state) | Log hardware_entry_failure_reason; abort |
| HV_EXIT_REASON_VTIMER macos:358 | Virtual timer fired (macOS HVF, ARM) | Inject virtual IRQ; resume |