Explore a virtual machine
Twenty-four lessons, QEMU execution records and six models connect exception levels, guest execution, memory protection, virtual I/O, interrupts, timers and read requests.
Study the concepts, combine the execution models, then build the Rust project. Actual WASM executions and measured QEMU records are labelled separately.
Build, diagnose and repair
Measured QEMU repairs
Connect MMIO, virtqueue, data transfer, virtual IRQs and reclamation. Compare six broken and repaired QEMU execution pairs.
Repair checks: 0 / 6
Loading…
Local implementation (self-reported): Not recorded
Start the implementation →Your reading and questions
Loading learning records…
Demo predictions and repair results appear separately below and are saved on this device.
Read and experiment in order
Foundations
Separate privilege, exception routing, and execution state before following a guest through EL1 and EL2.
Try the interactive model · Practise · Write a noteFoundations
Follow a round trip from EL2 into an EL1 guest and back, including register ownership and the return location.
Try the interactive model · Practise · Write a noteFoundations
Use concrete 4 KiB mappings to see how a guest OS and hypervisor control different translation stages.
Try the interactive model · Practise · Write a noteFoundations
Distinguish missing mappings, denied writes, and deliberate MMIO traps before choosing a response.
Try the interactive model · Practise · Write a noteFoundations
Trace a register write through trapping, validation, emulation, and guest resumption in a small UART model.
Try the interactive model · Practise · Write a noteFoundations
Follow split-ring descriptors, available and used entries, and buffer ownership without confusing notification with completion.
Try the interactive model · Practise · Write a noteExecution models
Separate device signals from interrupt handling state, then follow acknowledgement, EOI and deactivation to explain repeated delivery.
Try the interactive model · Practise · Write a noteExecution models
Diagnose a guest that waits despite pending work by checking recipient ownership, enable state, IRQ masking, and acknowledgement.
Try the interactive model · Practise · Write a noteExecution models
Compute virtual count as physical count minus offset, and distinguish deadline expiry, ENABLE, IMASK, and interrupt delivery.
Try the interactive model · Practise · Write a noteExecution models
Preserve per-VM offsets, CVAL, and controls across switches, then diagnose repeated timer delivery and deadline rearming.
Try the interactive model · Practise · Write a noteExecution models
Read descriptor direction from the device’s perspective and construct header, data, and status buffers for a split virtqueue.
Try the interactive model · Practise · Write a noteExecution models
Separate publication, notification, used-ring completion, and reclamation so that out-of-order requests release only their own buffers.
Try the interactive model · Practise · Write a noteRust implementation
Separate the entry point, EL2 stack, BSS, and guest storage, then verify the assumptions that let bare-metal Rust execute under QEMU.
Inspect QEMU recording · Practise · Write a noteRust implementation
Connect VBAR_EL2, exception classification, and register preservation to route a guest synchronous exception into a Rust handler.
Inspect QEMU recording · Practise · Write a noteRust implementation
Configure ELR_EL2, SPSR_EL2, and SP_EL1 for EL1h entry, then distinguish return addresses for HVC and emulated MMIO faults.
Inspect QEMU recording · Practise · Write a noteRust implementation
Read measured ESR, FAR, and HPFAR values, validate address, width, and direction, emulate one UART byte store, and resume only after success.
Inspect QEMU recording · Practise · Write a noteRust implementation
Read measured GICv3 setup on QEMU and establish the configuration and list-register state required for virtual interrupt injection from EL2.
Inspect QEMU recording · Practise · Write a noteRust implementation
Follow a measured guest IRQ handler through IAR, EOI, and DIR, distinguishing Pending, Active, and Invalid list-register states.
Inspect QEMU recording · Practise · Write a noteRust implementation
Follow a guest-programmed virtual timer from counter arithmetic to real EL2 expiry handling and virtual IRQ delivery, with explicit timing units.
Inspect QEMU recording · Practise · Write a noteRust implementation
Verify real guest resumption and three timer rearm cycles through pending-state preservation, delivery counts, and causal ordering rather than fixed counters.
Inspect QEMU recording · Practise · Write a noteRust implementation
Follow guest MMIO accesses into EL2, feature negotiation, queue configuration, and notification admission using Rust and captured QEMU execution.
Inspect QEMU recording · Practise · Write a noteRust implementation
Trace descriptors and available/used rings in a fixed arena, checking direction, bounds, overlap, and reuse of ring slots.
Inspect QEMU recording · Practise · Write a noteRust implementation
Follow request fields, destination bytes, and completion status on a four-sector memory disk, including final-sector reads and range/write rejection.
Inspect QEMU recording · Practise · Write a noteRust implementation
Connect result publication to IRQ forty, device acknowledgement, GIC completion, and used reclaim, distinguishing successful and IOERR results.
Inspect QEMU recording · Practise · Write a note
Put the parts together
Follow one request through its queue, device, virtual interrupt and reclamation.
Repair the example, then verify it under different conditions.
Interactive experiments
Playback, prediction answers and repairs are tracked separately in this browser.
Follow VA, IPA and PA separately, then change mappings and permissions.
Loading…
Open demo →Follow an EL1 access through EL2 handling and return to the guest.
Loading…
Open demo →Track publication, notification, processing and reclamation before reusing a buffer.
Loading…
Open demo →Separate pending and active state, masking, delivery and deactivation.
Loading…
Open demo →Change virtual time, deadlines, masks and per-VM timer contexts.
Loading…
Open demo →Track descriptor direction, request IDs, data and safe reclamation.
Loading…
Open demo →Follow one request through its queue, device, virtual interrupt and reclamation.
Loading…
Open demo →Build and run the Rust implementation
QEMU execution recording
Follow a measured QEMU run alongside Rust and assembly, memory placement, stacks and exception vectors.
Loading…
Local implementation (self-reported): Not recorded
QEMU execution recording
Inspect an EL1 UART access trapping to EL2, decoded instruction state, emulated output and guest resumption.
Loading…
Local implementation (self-reported): Not recorded
Run events and interrupts in Rust
QEMU execution recording
Connect measured UART output with source and inspect pending/active state, guest acknowledgement, EOI and deactivation.
Loading…
Local implementation (self-reported): Not recorded
QEMU execution recording
Inspect real Generic Timer expiry, notification, guest handling and rearming using measured counter values and execution logs.
Loading…
Local implementation (self-reported): Not recorded
Run reserved work and I/O in Rust
QEMU execution recording
Follow EL1 register accesses trapped at EL2, descriptor validation, ring-slot wraparound and rejection of malformed requests.
Loading…
Local implementation (self-reported): Not recorded
QEMU execution recording
Compare disk transfer, used-ring publication, virtual interrupt delivery and guest reclamation across successful, boundary and rejected requests.
Loading…
Local implementation (self-reported): Not recorded
My learning