[PATCH v2 0/5] spapr: Fix and cleanups for sPAPR CPU core

Greg Kurz posted 5 patches 3 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/160279669833.1808373.9524145092720289601.stgit@bahia.lan
Maintainers: Richard Henderson <rth@twiddle.net>, Paolo Bonzini <pbonzini@redhat.com>, Riku Voipio <riku.voipio@iki.fi>, David Gibson <david@gibson.dropbear.id.au>
accel/tcg/user-exec-stub.c      |    4 ++
hw/ppc/spapr_cpu_core.c         |   69 ++++++++++++++++++---------------------
target/ppc/translate_init.c.inc |    2 +
3 files changed, 37 insertions(+), 38 deletions(-)
[PATCH v2 0/5] spapr: Fix and cleanups for sPAPR CPU core
Posted by Greg Kurz 3 years, 6 months ago
While reading the code _again_ I spotted a memory leak and I realized
that the realize/unrealize paths are uselessly complex and not really
symmetrical.

This series fixes the leak and re-shuffles the code to make it cleaner.

Tested with 'make check', travis-ci and manual hotplug/unplug of CPU
cores. Also tested error paths by simulating failures when creating
interrupt presenters or when setting the vCPU id.

v2: - enforce symmetry between realize and unrealize
    - unrealize vCPUs with qdev_unrealize()
    - one loop to create/realize and to unrealize/delete vCPUs

---

Greg Kurz (5):
      spapr: Fix leak of CPU machine specific data
      spapr: Unrealize vCPUs with qdev_unrealize()
      spapr: Drop spapr_delete_vcpu() unused argument
      spapr: Make spapr_cpu_core_unrealize() idempotent
      spapr: Simplify spapr_cpu_core_realize() and spapr_cpu_core_unrealize()


 accel/tcg/user-exec-stub.c      |    4 ++
 hw/ppc/spapr_cpu_core.c         |   69 ++++++++++++++++++---------------------
 target/ppc/translate_init.c.inc |    2 +
 3 files changed, 37 insertions(+), 38 deletions(-)

--
Greg


Re: [PATCH v2 0/5] spapr: Fix and cleanups for sPAPR CPU core
Posted by David Gibson 3 years, 6 months ago
On Thu, Oct 15, 2020 at 11:18:18PM +0200, Greg Kurz wrote:
> While reading the code _again_ I spotted a memory leak and I realized
> that the realize/unrealize paths are uselessly complex and not really
> symmetrical.
> 
> This series fixes the leak and re-shuffles the code to make it cleaner.
> 
> Tested with 'make check', travis-ci and manual hotplug/unplug of CPU
> cores. Also tested error paths by simulating failures when creating
> interrupt presenters or when setting the vCPU id.
> 
> v2: - enforce symmetry between realize and unrealize
>     - unrealize vCPUs with qdev_unrealize()
>     - one loop to create/realize and to unrealize/delete vCPUs

Applied to ppc-for-5.2.

> 
> ---
> 
> Greg Kurz (5):
>       spapr: Fix leak of CPU machine specific data
>       spapr: Unrealize vCPUs with qdev_unrealize()
>       spapr: Drop spapr_delete_vcpu() unused argument
>       spapr: Make spapr_cpu_core_unrealize() idempotent
>       spapr: Simplify spapr_cpu_core_realize() and spapr_cpu_core_unrealize()
> 
> 
>  accel/tcg/user-exec-stub.c      |    4 ++
>  hw/ppc/spapr_cpu_core.c         |   69 ++++++++++++++++++---------------------
>  target/ppc/translate_init.c.inc |    2 +
>  3 files changed, 37 insertions(+), 38 deletions(-)
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson