[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 03/13] target/i386/hvf: Free resources when vCPU is destroyed
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 03/13] target/i386/hvf: Free resources when vCPU is destroyed |
Date: |
Wed, 23 Mar 2022 18:17:41 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Both xsave_buf and hvf_caps are allocated in hvf_arch_init_vcpu(),
free them in hvf_arch_vcpu_destroy().
Reported-by: Mark Kanda <mark.kanda@oracle.com>
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/i386/hvf/hvf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index fc12c02fb2..39fa4641b9 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -163,7 +163,9 @@ void hvf_arch_vcpu_destroy(CPUState *cpu)
X86CPU *x86_cpu = X86_CPU(cpu);
CPUX86State *env = &x86_cpu->env;
+ g_free(env->xsave_buf);
g_free(env->hvf_mmio_buf);
+ g_free(hvf_state->hvf_caps);
}
static void init_tsc_freq(CPUX86State *env)
--
2.35.1
- [PATCH v4 00/13] accel: Fix vCPU memory leaks, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 01/13] cpu: Free cpu->cpu_ases in cpu_address_space_destroy(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 02/13] target/i386/kvm: Free xsave_buf when destroying vCPU, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 03/13] target/i386/hvf: Free resources when vCPU is destroyed,
Philippe Mathieu-Daudé <=
- [PATCH v4 04/13] accel/hvf: Remove pointless assertion, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 05/13] accel/tcg: Init TCG cflags in vCPU thread handler, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 06/13] accel/tcg: Reorganize tcg_accel_ops_init(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 07/13] accel-ops: Introduce create_vcpu_thread_precheck / postcheck handlers, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 08/13] accel/tcg: Extract rr_create_vcpu_thread_precheck(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 09/13] accel/all: Extract common_vcpu_thread_create(), Philippe Mathieu-Daudé, 2022/03/23