Skip to content

P600Virtualization

Annex I · 20 notes

Hypervisor engineering notes on CPU and memory virtualization, KVM, interrupts, device emulation, virtio, guest boot, passthrough, snapshots, security, and building a Rust VMM across x86-64, ARM64, and RISC-V.

20
notes
489
minutes
261
references
52
diagrams

cat study-map

Purpose: Root navigation map for learning hardware virtualization deeply enough to build a production-minded Rust VMM on KVM for x86-64, ARM64, and RISC-V.

Virtualization

A virtual machine monitor is a user-space program that asks the kernel (KVM) to run guest code directly on the CPU, then emulates everything the CPU cannot do safely on its own: devices, firmware tables, interrupts, clocks, and boot. Hardware does the heavy lifting for CPU and memory isolation. The VMM owns policy, devices, lifecycle, and the attack surface.

This note is the map, not the content. Use it to choose what to read next and to see how the pieces depend on each other.

The fastest path is not "read every spec, then write a VMM." It is: understand trap-and-emulate, run a few guest instructions through KVM_RUN, then grow the VMM one exit reason, one device, and one architecture at a time.

Note set

LayerNotesWhat they are forExit signal
Orientation00 Virtualization Mastery Roadmap, 01 Virtualization Mental Model and HistoryStudy order, project ladder, and the core trap-and-emulate model.You can explain why classic x86 needed binary translation and what VT-x changed.
CPU02 x86-64 Architecture for Hypervisor Authors, 03 Intel VT-x and AMD-V Hardware Virtualization, 15 ARM64 Virtualization EL2 VHE and GIC, 16 RISC-V Virtualization and the Hypervisor ExtensionPrivilege models, paging, system registers, and the hardware virtualization extension of each architecture.You can set up a vCPU to enter 64-bit code directly on each architecture.
KVM core04 KVM API and the vCPU Run Loop, 05 Memory Virtualization EPT NPT and Guest Memory, 06 Interrupts Timers and Interrupt Controller VirtualizationThe ioctl surface, the run loop, guest memory, interrupt injection, and time.Your VMM boots a guest that takes timer interrupts and halts cleanly.
Devices07 Device Emulation PIO MMIO and the Bus Model, 08 Virtio Devices Virtqueues and vhost, 10 Storage and Network Backends, 11 Device Passthrough VFIO IOMMU and Nested VirtualizationEmulated devices, paravirtual virtio devices, host backends, and real hardware passthrough.The guest has a console, a root disk, and a network interface.
Lifecycle09 Booting Guests Firmware and the Linux Boot Protocol, 12 Snapshots Live Migration and Dirty Page TrackingGetting a kernel running, and capturing or moving a running VM.You can boot Linux in under a second and restore it from a snapshot.
Production13 Security Isolation and Attack Surface, 14 Performance Observability and DebuggingThreat model, sandboxing, exit costs, tracing, and debugging.You can justify every device you expose and measure every exit you take.
Ecosystem17 Hypervisor Architectures Compared, 18 Rust VMM Ecosystem and Project TemplatesHow existing VMMs are built and which rust-vmm crates to reuse.You can sketch your VMM's crate layout and defend each design choice.

Adjacent vault anchors

Mental model

Rendering diagram...

Three questions frame every design decision:

  1. Who handles this exit? Hardware, KVM in the kernel, or your VMM in user space. Each step outward costs more time.
  2. What does the guest see? Every register, device, table, and clock is part of a contract you must keep stable across restore and migration.
  3. What can a hostile guest reach? Every byte the guest can write into your VMM is attack surface.

Study paths

GoalPath
First working VMM on x8600, 01, 02, 04, 05, 07, 09
Fast Linux microVMadd 06, 08, 10, 14
Multi-architecture VMMadd 03, 15, 16
Production hardeningadd 11, 12, 13, 17, 18

Review checklist

  • Every leaf note links back to this map or the roadmap.
  • Architecture-specific claims name the architecture.
  • Facts are checked against the Primary Sources listed in each note.
  • New notes use the NN Title filename pattern and the shared frontmatter.

ls virtualization/ --order=reading

victor-bona · terminal

type help for commands · esc to close