{ "comment": "The virtual machine, as both the page (site/js/boot.js) and the snapshot tool (tools/make-snapshot.py) start it. A migration stream only resumes on a machine that matches the one it was taken from, device for device, so this is the one place the machine is described. {pack} is the -L directory holding the kernel, initramfs and BIOS blobs, {share} the directory exported over 9p, {ram} the guest RAM. The 9p device is spelled out rather than left as -virtfs sugar so ioeventfd can be turned off. With it on, a request is handed to QEMU's main loop through a pipe; that loop now sleeps on its own deadline rather than spinning, so every request would wait on it. Off, the handler runs on the vCPU thread inside the kick that raised it, and the main loop is free to sleep. The CPU model is a Haswell without TSX (the -v4 alias), which is x86-64-v3: SSE4.2, POPCNT, BMI and AVX2. The default qemu64 is x86-64-v1, and a prebuilt binary that assumes anything newer dies on SIGILL the moment it starts -- opencode, a Bun binary needing SSE4.2, printed \"Illegal instruction\" and nothing else. Under TCG a wider vector unit costs nothing, since one emulated instruction then covers more bytes -- glibc's AVX2 string routines measured faster than its SSE2 ones inside qemu. Haswell-v4 is as new as the model can go and still be one TCG implements whole: plain Haswell asks for TSX and Skylake for xsavec and xsaves, and TCG drops each of those with a warning. The guest is given a source of randomness two ways, because without one the kernel's pool starts empty after a resume and the first caller of getrandom() spins in a TSC-jitter loop for fifteen seconds: +rdrand lets the pool initialise at once (the kernel is built to trust it; Haswell carries the instruction anyway, and the flag stays spelled out because the fifteen seconds come back without it), and virtio-rng-pci keeps feeding it afterwards so each visitor reseeds from their own browser's randomness rather than from whatever the shared snapshot froze. Change anything here and the snapshot has to be retaken (docs/engine.md); the pins carry this file's hash so checks.snapshot notices.", "ram": "512M", "args": [ "-nographic", "-cpu", "Haswell-v4,+rdrand", "-device", "virtio-rng-pci", "-m", "{ram}", "-accel", "tcg,tb-size=500", "-L", "{pack}/", "-nic", "none", "-kernel", "{pack}/bzImage", "-initrd", "{pack}/initramfs.cpio.gz", "-fsdev", "local,id=store0,path={share},security_model=none", "-device", "virtio-9p-pci,fsdev=store0,mount_tag=store0,ioeventfd=off", "-append", "console=ttyS0 rdinit=/init loglevel=4 mitigations=off" ] }