From: Matheus Tavares Bernardino <[email protected]>

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 <[email protected]>
Reviewed-by: Pierrick Bouvier <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-ID: 
<ee6f642af1dab29aaf99f86ac9254ddd25765bf8.1776172276.git.matheus.bernard...@oss.qualcomm.com>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 target/arm/hvf/hvf.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index a5b30b9ef0d..8b902c68829 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -1301,15 +1301,10 @@ void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu)
 
 void hvf_arch_vcpu_destroy(CPUState *cpu)
 {
-    hv_return_t ret;
-
     if (!hvf_irqchip_in_kernel()) {
         timer_free(cpu->accel->wfi_timer);
         cpu->accel->wfi_timer = NULL;
     }
-
-    ret = hv_vcpu_destroy(cpu->accel->fd);
-    assert_hvf_ok(ret);
 }
 
 static bool hvf_arm_el2_supported(void)
-- 
2.53.0


Reply via email to