@samitouri / QOSamiQemu / commits / 9f721c9e3c

accel/hvf: fix double hv_vcpu_destroy() causing teardown error on ARM

The following callstack causes hv_vcpu_destroy() to be called twice, producing HV_BAD_ARGUMENT on the already-destroyed handler: hvf_vcpu_destroy | |_ hv_vcpu_destroy | |_ hvf_arch_vcpu_destroy | |_ hv_vcpu_destroy The first hv_vcpu_destroy call covers both x86 and arm. Let's remove the second one, as it is redundant. This reverts commit feee55d36a1c5d494ee73812d279b439bb05137c. Signed-off-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <ee6f642af1dab29aaf99f86ac9254ddd25765bf8.1776172276.git.matheus.bernardino@oss.qualcomm.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

Matheus Tavares Bernardino committed Apr 14, 2026 at 06:11 UTC 9f721c9e3c7b9991abad4bb9864fa1cc7c833bed
1 file changed -5
target/arm/hvf/hvf.c
-5
@@ -1301,15 +1301,10 @@ void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu)
1301
1302 void hvf_arch_vcpu_destroy(CPUState *cpu)
1303 {
1304 - hv_return_t ret;
1305 -
1304 if (!hvf_irqchip_in_kernel()) {
1305 timer_free(cpu->accel->wfi_timer);
1306 cpu->accel->wfi_timer = NULL;
1307 }
1310 -
1311 - ret = hv_vcpu_destroy(cpu->accel->fd);
1312 - assert_hvf_ok(ret);
1308 }
1309
1310 static bool hvf_arm_el2_supported(void)