qemu-system-aarch64: Synchronous Exception with smp > 1 (on M1 running Asahi Linux with KVM)
Hi,
with recent release of qemu-7.0, I gave a try to KVM support on Asahi Linux for Apple M1 (mac mini).
When trying to set -smp > 1, it hangs immediately on boot with error message:
Synchronous Exception @0x...
Very rarely, the system can boot, but has a "random" reduced number of cpu. It could be a race condition somewhere.
Environment
- Arch: aarch64
- Processor: Apple M1
- Kernel: Linux m1 5.17.0-rc7-asahi-next-20220310-5-2-ARCH
Reproduce
Command line is inspired by this: http://cdn.kernel.org/pub/linux/kernel/people/will/docs/qemu/qemu-arm64-howto.html
EFI used is https://packages.debian.org/sid/qemu-efi-aarch64 (version 2022.02-3)
Full command line:
qemu-system-aarch64 \
-M virt \
-cpu host -enable-kvm -m 8G \
-smp 8 \
-drive if=pflash,format=raw,file=efi.img,readonly=on \
-drive if=pflash,format=raw,file=varstore.img \
-drive if=virtio,format=qcow2,file=disk.img \
-device virtio-scsi-pci,id=scsi0 \
-object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-rng-pci,rng=rng0 \
-device virtio-net-pci,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::8022-:22 \
-drive if=none,id=cd,file=debian-11.3.0-arm64-netinst.iso \
-device scsi-cd,drive=cd \
-nographic
Investigation
I noticed a previous commit was working well.
After bisection, the guilty commit seems to be 52c235ad.
By reverting it (on top of master), this solves the issue.
Edited by Pierrick Bouvier