qemu plan - MarekBykowski/readme GitHub Wiki
QEMU / ARM64 Virtualization Plan (prep for ZF, from 2026-11-16)
Goal: hands-on experience with QEMU ARM64 platforms, device modeling, KVM/hypervisors, QNX, Gunyah and CI before the ZF ADAS/HPC project (via Onwelo) starts on 2026-11-16.
Environment
| What | Where |
|---|---|
| Container | qemu-dev (image qemu-dev:marek), --restart unless-stopped |
| SSH to container | ssh -p 2222 marek@localhost (local only) |
| Dockerfile and scripts | ~/qemu/docker/ (Dockerfile, docker_me.sh: qemu_build, qemu_run, qemu_restart, qemu_ssh) |
/work (container) |
~/qemu/work on the host (NVMe, bind mount) |
| Yocto downloads, sstate | /mnt/frigate/qemu-yocto/ (HDD, same path in the container) |
| QEMU sources and build | /work/qemu (master), binary /work/qemu/build/qemu-system-aarch64 |
| meta-arm | /work/meta-arm (branch wrynose) |
| Yocto | /work/yocto (kas config qemuarm64-secureboot.yml, build dir build/) |
| Boot script | /work/scripts/run-qemu.sh [-g] [-s] |
| Logs | /work/logs/ |
Done
1. Container environment
- Ubuntu 24.04, UID/GID matching the host (1000:1000), sshd, kas 5.5, QEMU build dependencies
2. QEMU from source (master)
cd /work/qemu
./configure --target-list=aarch64-softmmu --enable-slirp --enable-fdt=system --disable-docs
make -C build -j$(nproc)
- Version 11.1.50 (
v11.1.0-3704-g71f25c7541)
3. meta-arm qemuarm64-secureboot on our QEMU
- Stack: TF-A v2.14.1 (BL1/BL2/BL31) → OP-TEE 4.9.0 (BL32) → U-Boot 2026.01 (BL33) → Linux 6.18 (
core-image-base, Poky 6.0.4) - Build:
cd /work/yocto && kas build qemuarm64-secureboot.yml # or: source core/oe-init-build-env build && bitbake core-image-base - Boot:
/work/scripts/run-qemu.sh -s - Guest SSH (from inside the container):
ssh -p 10022 root@localhost - Result: the full chain boots; OP-TEE
xtestpassed (41356 subtests, 0 failed)
Next (each step needs a go-ahead)
4. Own device model in QEMU (device modeling)
- Simple MMIO device: QOM type,
MemoryRegion+ read/write ops, registers, IRQ, trace events - Wire it into the
virtmachine, with a node in the generated DT - Linux driver in Yocto (devtool) + userspace test
- Optional: the same device in
sbsa-ref
5. KVM inside the guest (hypervisors, EL2, stage-2, vGIC)
-
-M virt,secure=on,virtualization=on, so the emulated CPU gets EL2 - Kernel with KVM, nested guest started from inside the guest (QEMU or kvmtool in the image)
- Note: the host is x86, so everything runs on TCG (slow, but it works)
6. QNX 8.0 on QEMU aarch64 (biggest gap compared with the job description)
- myQNX account + non-commercial or evaluation license (on my side)
- Boot QNX on QEMU
virt
7. Gunyah on QEMU (Qualcomm virtualization)
- Check QEMU platform support in
gunyah-hypervisorand the upstream status - Boot Gunyah + Linux VM on QEMU
8. CI
- Headless scripts: build QEMU + stack, boot test, xtest, check results from logs
9. Later: an FVP machine in QEMU
-
qemuarm64-sbsa: QEMU-M sbsa-ref, TF-A + EDK2 (UEFI), ACPI. Built like a real board (fixed memory map, TF-A platformqemu_sbsa), which makes it the template. -
fvp-base(Arm FVP, EULA accepted) as a reference - Own
fvp-base-like machine in QEMU, modeled onhw/arm/sbsa-ref.c- sbsa-ref maintainer: Peter Maydell; reviewer: Leif Lindholm; list: [email protected]
- Option: bring
qemuarm64-sbsaforward before step 4 (cheap, since downloads and sstate are shared)
History of plan changes
- 2026-10-29: the goal was an FVP machine in QEMU, so the order was
qemuarm64-sbsa→fvp-base→ own machine. - 2026-11-07: after the ZF job description, the plan was reordered around its requirements (
virt, own device, KVM, QNX, Gunyah, CI), and sbsa and FVP moved to "later". Started withqemuarm64-secureboot.