accel/hvf/hvf-accel-ops.c | 3 --- 1 file changed, 3 deletions(-)
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
Let's remove the redundant call at first function.
Signed-off-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
---
accel/hvf/hvf-accel-ops.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
index b74a5779c3..d1c532f7e0 100644
--- a/accel/hvf/hvf-accel-ops.c
+++ b/accel/hvf/hvf-accel-ops.c
@@ -113,9 +113,6 @@ static void do_hvf_get_vcpu_exec_time(CPUState *cpu, run_on_cpu_data arg)
static void hvf_vcpu_destroy(CPUState *cpu)
{
- hv_return_t ret = hv_vcpu_destroy(cpu->accel->fd);
- assert_hvf_ok(ret);
-
hvf_arch_vcpu_destroy(cpu);
g_free(cpu->accel);
cpu->accel = NULL;
--
2.37.2
Hi Matheus,
On 13/4/26 18:01, Matheus Tavares Bernardino wrote:
> 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
>
> Let's remove the redundant call at first function.
>
> Signed-off-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
> ---
> accel/hvf/hvf-accel-ops.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
> index b74a5779c3..d1c532f7e0 100644
> --- a/accel/hvf/hvf-accel-ops.c
> +++ b/accel/hvf/hvf-accel-ops.c
> @@ -113,9 +113,6 @@ static void do_hvf_get_vcpu_exec_time(CPUState *cpu, run_on_cpu_data arg)
>
> static void hvf_vcpu_destroy(CPUState *cpu)
> {
> - hv_return_t ret = hv_vcpu_destroy(cpu->accel->fd);
> - assert_hvf_ok(ret);
That would break x86. I suppose I screwed something in commit
feee55d36a1 ("accel/hvf: Implement hvf_arch_vcpu_destroy"). This
was part of my split-accel work which as of today I flushed out
of my head so don't recall well.
At any rate, better to remove the duplicate call in ARM's
hvf_arch_vcpu_destroy(), WDYT?
> hvf_arch_vcpu_destroy(cpu);
> g_free(cpu->accel);
> cpu->accel = NULL;
On Mon, Apr 13, 2026 at 7:06 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Hi Matheus,
>
> On 13/4/26 18:01, Matheus Tavares Bernardino wrote:
>
> > @@ -113,9 +113,6 @@ static void do_hvf_get_vcpu_exec_time(CPUState *cpu, run_on_cpu_data arg)
> >
> > static void hvf_vcpu_destroy(CPUState *cpu)
> > {
> > - hv_return_t ret = hv_vcpu_destroy(cpu->accel->fd);
> > - assert_hvf_ok(ret);
>
> That would break x86. I suppose I screwed something in commit
> feee55d36a1 ("accel/hvf: Implement hvf_arch_vcpu_destroy"). This
> was part of my split-accel work which as of today I flushed out
> of my head so don't recall well.
>
> At any rate, better to remove the duplicate call in ARM's
> hvf_arch_vcpu_destroy(), WDYT?
Ah, indeed, I hadn't noticed x86's callstack. Let's do that, I'll send a re-roll
© 2016 - 2026 Red Hat, Inc.