From c9586ff68d0815938e470d53f2ed2c66b537bb45 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sat, 26 Sep 2026 20:25:20 -0700 Subject: [PATCH] fix(hack): use the host CPU model for accelerated aarch64 VMs The aarch64 dev VM always used -cpu cortex-a57, even with -accel hvf or -accel kvm. QEMU rejects named CPU models with hvf, and with KVM unless the host has that CPU, so booting natively on Apple Silicon or an aarch64 Linux host with KVM failed. Use -cpu host when accelerated. --- hack/dev/boot.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hack/dev/boot.sh b/hack/dev/boot.sh index 40f3984..f9aa8b0 100755 --- a/hack/dev/boot.sh +++ b/hack/dev/boot.sh @@ -15,7 +15,12 @@ set -- if [ "${TARGET_ARCH}" = "x86_64" ]; then set -- "${@}" qemu-system-x86_64 -M q35 -cpu SandyBridge,vmx=on elif [ "${TARGET_ARCH}" = "aarch64" ]; then - set -- "${@}" qemu-system-aarch64 -M virt -cpu cortex-a57 + # Hardware acceleration on aarch64 only supports the host CPU model. + if [ -n "${QEMU_ACCEL}" ] && [ "${QEMU_ACCEL}" != "tcg" ]; then + set -- "${@}" qemu-system-aarch64 -M virt -cpu host + else + set -- "${@}" qemu-system-aarch64 -M virt -cpu cortex-a57 + fi fi if [ -n "${QEMU_ACCEL}" ]; then