From: Philippe Mathieu-Daudé Date: Tue, 1 Jul 2025 14:08:34 +0000 (+0100) Subject: hw/arm/virt: Make EL2 accelerator check an accept-list X-Git-Tag: v10.1.0-rc0~37^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=164258da4a24464a502b6ece6fce9fc6ca1c0207;p=thirdparty%2Fqemu.git hw/arm/virt: Make EL2 accelerator check an accept-list Currently only the TCG and qtest accelerators can handle an EL2 guest. Instead of making the condition check be "fail if KVM or HVF" (an exclude-list), make it a be "allow if TCG or qtest" (an accept-list). This is better for if/when we add new accelerators, as it makes the default be that we forbid an EL2 guest. This is the most likely to be correct and also "fails safe"; if the new accelerator really can support EL2 guests then the implementor will see that they need to add it to the accept-list. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Message-id: 20250623121845.7214-20-philmd@linaro.org [PMM: rewrote commit message] Signed-off-by: Peter Maydell --- diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b3b1c6df7fa..30f91bcfb3c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2207,7 +2207,7 @@ static void machvirt_init(MachineState *machine) exit(1); } - if (vms->virt && (kvm_enabled() || hvf_enabled())) { + if (vms->virt && !tcg_enabled() && !qtest_enabled()) { error_report("mach-virt: %s does not support providing " "Virtualization extensions to the guest CPU", current_accel_name());