mbox series

[v4,00/13] accel: Fix vCPU memory leaks

Message ID 20220323171751.78612-1-philippe.mathieu.daude@gmail.com (mailing list archive)
Headers show
Series accel: Fix vCPU memory leaks | expand

Message

Philippe Mathieu-Daudé March 23, 2022, 5:17 p.m. UTC
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Hi,

This is a respin of Mark 'vCPU hotunplug related memory leaks' v3:
https://lore.kernel.org/qemu-devel/20220321141409.3112932-1-mark.kanda@oracle.com/

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(-)