Unable to start CirrOS 0.5.1 on QEMU 7.0 with -M virt and -cpu max

Host environment

  • Operating system: Debian 11 with kernel from Debian/unstable
  • OS/kernel version: Linux jagular 5.17.0-3-arm64 #1 SMP Debian 5.17.11-1 (2022-05-26) aarch64 GNU/Linux
  • Architecture: AArch64
  • QEMU flavor: qemu-system-aarch64
  • QEMU version: QEMU emulator version 7.0.0 (Debian 1:7.0+dfsg-2~bpo11+2)
  • QEMU command line:
    qemu-system-aarch64 -drive file=cirros-0.5.1-aarch64-disk.img -M virt -m 2048 \
       -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -cpu max -nographic
  • UEFI image from "qemu-efi-aarch64" 2020.11-2+deb11u1 package from Debian 11.

Emulated/Virtualized environment

  • Operating system: CirrOS 0.5.1
  • OS/kernel version: 5.3.0-26.28~18.04.1-generic (CirrOS uses Ubuntu kernels)
  • Architecture: AArch64

Description of problem

Steps to reproduce

  1. Fetch CirrOS image: wget https://github.com/cirros-dev/cirros/releases/download/0.5.1/cirros-0.5.1-aarch64-disk.img
  2. Run QEMU:
    qemu-system-aarch64 -drive file=cirros-0.5.1-aarch64-disk.img -M virt -m 2048 \
       -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -cpu max -nographic

Additional information

When image boots, GRUB window appears for a second and then kernel/initramfs are loaded and booted:

EFI stub: Booting Linux Kernel...
EFI stub: EFI_RNG_PROTOCOL unavailable, no randomness supplied
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services and installing virtual address map...

When everything is fine we can see kernel output:

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]
[    0.000000] Linux version 5.3.0-26-generic (buildd@bos02-arm64-028) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)) #28~18.04.1-Ubuntu SMP Wed Dec 18 16:41:01 UTC 2019 (Ubuntu 5.3.0-26.28~18.04.1-generic 5.3.13)
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: EFI v2.70 by EDK II

But on QEMU 7.0 with -M virt -cpu max we never get kernel output.

Tested combinations

QEMU version virt/cpu arguments status
QEMU 5.2 from Debian 11 -M virt -cpu max Works
QEMU 6.2 from Debian 11 backports -M virt -cpu max Works
QEMU 7.0 from Debian 11 backports -M virt -cpu max Fails
QEMU 7.0 from Debian 11 backports -M virt-6.2 -cpu max Works
QEMU 7.0 from Debian 11 backports -M virt -cpu cortex-a72 Works

I switched our project (OpenStack Kolla) to use Cortex-A72 for now.

Planning to check with recent QEMU code later this week.

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