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.
This commit is contained in:
alex authored and Alex Zenla committed 2026-09-26 20:52:15 -07:00
1 parent 592d7b41f6
commit c9586ff68d
1 file changed
+5
+5
View File
@@ -15,8 +15,13 @@ set --
if [ "${TARGET_ARCH}" = "x86_64" ]; then if [ "${TARGET_ARCH}" = "x86_64" ]; then
set -- "${@}" qemu-system-x86_64 -M q35 -cpu SandyBridge,vmx=on set -- "${@}" qemu-system-x86_64 -M q35 -cpu SandyBridge,vmx=on
elif [ "${TARGET_ARCH}" = "aarch64" ]; then elif [ "${TARGET_ARCH}" = "aarch64" ]; then
# 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 set -- "${@}" qemu-system-aarch64 -M virt -cpu cortex-a57
fi fi
fi
if [ -n "${QEMU_ACCEL}" ]; then if [ -n "${QEMU_ACCEL}" ]; then
set -- "${@}" "-accel" "${QEMU_ACCEL}" set -- "${@}" "-accel" "${QEMU_ACCEL}"