Skip to content

accel: Fix vCPU memory leaks

Philippe Mathieu-Daudé qemu-devel xen-devel 1 version Applied

Status from this message: Queued to tcg-next.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest13 patches 16 repliesApplied

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/13cpu: Free cpu->cpu_ases in cpu_address_space_destroy()cpu.c include/exec/cpu-common.h softmmu/physmem.c+13 -02 replies
2/13target/i386/kvm: Free xsave_buf when destroying vCPUtarget/i386/kvm/kvm.c+2 -01 reply
3/13target/i386/hvf: Free resources when vCPU is destroyedtarget/i386/hvf/hvf.c+2 -01 reply
4/13accel/hvf: Remove pointless assertionaccel/hvf/hvf-accel-ops.c+0 -60 replies
5/13accel/tcg: Init TCG cflags in vCPU thread handleraccel/tcg/tcg-accel-ops-mttcg.c accel/tcg/tcg-accel-ops-rr.c+5 -72 replies
6/13accel/tcg: Reorganize tcg_accel_ops_init()accel/tcg/tcg-accel-ops.c+8 -72 replies
7/13accel-ops: Introduce create_vcpu_thread_precheck / postcheck handlersinclude/sysemu/accel-ops.h softmmu/cpus.c+11 -11 reply
8/13accel/tcg: Extract rr_create_vcpu_thread_precheck()accel/tcg/tcg-accel-ops-rr.c accel/tcg/tcg-accel-ops-rr.h+8 -00 replies
9/13accel/all: Extract common_vcpu_thread_create()accel/accel-softmmu.c accel/dummy-cpus.c accel/hvf/hvf-accel-ops.c +14 more+56 -1462 replies
10/13accel-ops: Introduce common_vcpu_thread_destroy() and .precheck handlerinclude/sysemu/accel-ops.h softmmu/cpus.c+11 -01 reply
11/13accel/tcg: Add rr_destroy_vcpu_thread_precheck()accel/tcg/tcg-accel-ops-rr.c accel/tcg/tcg-accel-ops.c+10 -01 reply
12/13softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_thread()softmmu/cpus.c+1 -02 replies
13/13softmmu/cpus: Free cpu->halt_cond in generic_destroy_vcpu_thread()softmmu/cpus.c+1 -01 reply

Reviews trailers per patch

3 of 13 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéMark KandaRichard Henderson
1/13T-b
2/13T-b R-b
3/13R-b
4/13
5/13
6/13R-b
7/13
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/13] accel: Fix vCPU memory leaks

From: Philippe Mathieu-Daudé <[email protected]>

Hi,

This is a respin of Mark 'vCPU hotunplug related memory leaks' v3:
https://lore.kernel.org/qemu-devel/[email protected]/

Instead I refactored to extract the common common_vcpu_thread_create() from all accelerators (except TCG/RR, which requires a special-casing).

Not well tested...

Mark Kanda (3):
cpu: Free cpu->cpu_ases in cpu_address_space_destroy() softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_thread() softmmu/cpus: Free cpu->halt_cond in generic_destroy_vcpu_thread()

Philippe Mathieu-Daudé (10):
target/i386/kvm: Free xsave_buf when destroying vCPU target/i386/hvf: Free resources when vCPU is destroyed accel/hvf: Remove pointless assertion
accel/tcg: Init TCG cflags in vCPU thread handler accel/tcg: Reorganize tcg_accel_ops_init()
accel-ops: Introduce create_vcpu_thread_precheck / postcheck handlers accel/tcg: Extract rr_create_vcpu_thread_precheck() accel/all: Extract common_vcpu_thread_create()
accel-ops: Introduce common_vcpu_thread_destroy() and .precheck
handler
accel/tcg: Add rr_destroy_vcpu_thread_precheck()

 accel/accel-softmmu.c             |  2 +-
 accel/dummy-cpus.c                | 15 +----------
 accel/hvf/hvf-accel-ops.c         | 24 +++--------------
 accel/kvm/kvm-accel-ops.c         | 17 +++---------
 accel/qtest/qtest.c               |  3 ++-
 accel/tcg/tcg-accel-ops-mttcg.c   | 27 +++----------------
 accel/tcg/tcg-accel-ops-mttcg.h   |  3 +--
 accel/tcg/tcg-accel-ops-rr.c      | 44 +++++++++++++++----------------
 accel/tcg/tcg-accel-ops-rr.h      |  7 +++--
 accel/tcg/tcg-accel-ops.c         | 22 +++++++++-------
 accel/xen/xen-all.c               |  2 +-
 cpu.c                             |  1 +
 include/exec/cpu-common.h         |  7 +++++
 include/sysemu/accel-ops.h        |  9 ++++++-
 include/sysemu/cpus.h             |  4 +--
 softmmu/cpus.c                    | 40 +++++++++++++++++++++++++---
 softmmu/physmem.c                 |  5 ++++
 target/i386/hax/hax-accel-ops.c   | 20 ++------------
 target/i386/hvf/hvf.c             |  2 ++
 target/i386/kvm/kvm.c             |  2 ++
 target/i386/nvmm/nvmm-accel-ops.c | 17 +++---------
 target/i386/whpx/whpx-accel-ops.c | 20 +++-----------
 22 files changed, 127 insertions(+), 166 deletions(-)
Signature · 1 line
2.35.1