target/arm: cannot boot when CPU supports SME

Host environment

  • Operating system: macOS
  • OS/kernel version: macOS 15.2 Beta 24C5073e
  • Architecture: ARM64 (Apple M4)
  • QEMU flavor: qemu-system-aarch64
  • QEMU version: main branch
  • QEMU command line: qemu-system-aarch64 -cpu host -accel hvf ...

Emulated/Virtualized environment

  • Operating system: any
  • OS/kernel version: any
  • Architecture: ARM64

Description of problem

On macOS 15.2 beta, Apple's Hypervisor.framework exposes the SME feat flag to QEMU. As a result, in arm_cpu_sme_finalize, cpu_isar_feature(aa64_sme, cpu) returns true and the program will always exit with the following:

qemu-aarch64-softmmu: cannot disable sme4224
All SME vector lengths are disabled.
With SME enabled, at least one vector length must be enabled.

This is because vq_supported and vq_init are both 0 as they are not initialized anywhere. It seems that in the original commit e74c0976 the only place cpu->sme_vq.supported is initialized is with aarch64_max_initfn when KVM and HVF are not used as the backend.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information