Assert error with accel=hvf:tcg when hvf is unavailable
Host environment
- Operating system: Mac OS guest under Mac OS
- Architecture: ARM
- QEMU flavor: qemu-system-aarch64
- QEMU version: 10.0.0
- QEMU command line: qemu-system-aarch64 -machine virt,accel=hvf:tcg
Emulated/Virtualized environment
- Architecture: ARM
Description of problem
Trying to start qemu with -machine virt,accel=hvf:tcg in a Mac OS guest under Mac OS host, both arm64. I expect it to try hvf (unavailable - nested virtualization not supported) and fallback to tcg. Documentation for accel option says "If there is more than one accelerator specified, the next one is used if the previous one fails to initialize." This works fine with kvm, but for hvf it crashes in some auxiliary function when trying it:
% qemu-system-aarch64 -machine virt,accel=hvf:tcg
qemu-system-aarch64: Error: ret = HV_UNSUPPORTED (0xfae9400f, at ../target/arm/hvf/hvf.c:949)
Stack trace
* frame #0: 0x0000000193a18388 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x0000000193a5188c libsystem_pthread.dylib`pthread_kill + 296
frame #2: 0x000000019395ac60 libsystem_c.dylib`abort + 124
frame #3: 0x00000001005ee7f4 qemu-system-aarch64`assert_hvf_ok_impl + 92
frame #4: 0x000000010032a550 qemu-system-aarch64`hvf_arm_get_max_ipa_bit_size + 64
frame #5: 0x0000000100334928 qemu-system-aarch64`virt_hvf_get_physical_address_range + 68
frame #6: 0x00000001005ee9b8 qemu-system-aarch64`hvf_accel_init + 68
frame #7: 0x00000001002ef8e4 qemu-system-aarch64`accel_init_machine + 92
frame #8: 0x00000001002a6640 qemu-system-aarch64`do_configure_accelerator + 208
frame #9: 0x0000000100782bdc qemu-system-aarch64`qemu_opts_foreach + 112
frame #10: 0x00000001002a3180 qemu-system-aarch64`qemu_init + 11344
frame #11: 0x00000001006ea76c qemu-system-aarch64`main + 36
frame #12: 0x00000001936b2b4c dyld`start + 6000
Edited by Ivan Krasilnikov