Newer qemu versions need a cpu flag to boot older aarch64 kernels
While upgrading the OS versions in a CI pipeline, I ended up with a more recent version of QEMU that adds support for the aarch64 FEAT_LPA2 (52-bit virtual addresses). It turns out that the Linux boot code before version 5.12.0 (and recent 5.10 LTS versions) interprets the architecture register indicating support for this feature incorrectly and halts the CPU very early in the boot process.
Here's the QEMU issue about this: https://gitlab.com/qemu-project/qemu/-/issues/964
I have made a tiny patch that always disables lpa2 for non-kvm booting of aarch64 kernels: https://github.com/pinealservo/vmtest/tree/disable_lpa2
I'd be happy to open a PR with that change, but according to the info in the QEMU issue, it's not quite universal if you want to boot even older kernels. Maybe some sort of override for setting the cpu flag is warranted? I didn't want to dive into things involving config changes without any discussion, so I figured I'd open an issue instead.
Hi! Sorry about the delay. I think we do want to support booting older kernels. I think wiring through some user-provided -cpu flags is appropriate. Thanks for checking.