[Qemu-devel] [PATCH 0/2] monitor: increase the refcount of the current CPU

Greg Kurz posted 2 patches 6 years, 6 months ago
Failed in applying to current master (apply log)
hw/ppc/spapr.c                  |   10 +++-------
hw/ppc/spapr_cpu_core.c         |   29 +++++++++--------------------
include/hw/ppc/spapr_cpu_core.h |    2 +-
monitor.c                       |   12 ++++++++++++
4 files changed, 25 insertions(+), 28 deletions(-)
[Qemu-devel] [PATCH 0/2] monitor: increase the refcount of the current CPU
Posted by Greg Kurz 6 years, 6 months ago
If a CPU selected with the "cpu" command is hot-unplugged then "info cpus"
causes QEMU to exit:
    
(qemu) device_del cpu1
(qemu) info cpus
qemu:qemu_cpu_kick_thread: No such process

I could verify that this happens with x86 and ppc, but I guess s390x is
also impacted.

This series tries to fix the issue by using object_ref() and object_unref()
in the monitor code. For this to work on ppc, some preliminary work is
needed to let QOM handle the CPU object lifecycle.

Please comment.

--
Greg

---

Greg Kurz (2):
      spapr_cpu_core: instantiate CPUs separately
      monitor: add proper reference counting of the current CPU


 hw/ppc/spapr.c                  |   10 +++-------
 hw/ppc/spapr_cpu_core.c         |   29 +++++++++--------------------
 include/hw/ppc/spapr_cpu_core.h |    2 +-
 monitor.c                       |   12 ++++++++++++
 4 files changed, 25 insertions(+), 28 deletions(-)


Re: [Qemu-devel] [PATCH 0/2] monitor: increase the refcount of the current CPU
Posted by Cornelia Huck 6 years, 6 months ago
On Fri, 13 Oct 2017 10:35:06 +0200
Greg Kurz <groug@kaod.org> wrote:

> If a CPU selected with the "cpu" command is hot-unplugged then "info cpus"
> causes QEMU to exit:
>     
> (qemu) device_del cpu1
> (qemu) info cpus
> qemu:qemu_cpu_kick_thread: No such process
> 
> I could verify that this happens with x86 and ppc, but I guess s390x is
> also impacted.

Not really, as s390x does not support cpu unplug.

> 
> This series tries to fix the issue by using object_ref() and object_unref()
> in the monitor code. For this to work on ppc, some preliminary work is
> needed to let QOM handle the CPU object lifecycle.
> 
> Please comment.
> 
> --
> Greg
> 
> ---
> 
> Greg Kurz (2):
>       spapr_cpu_core: instantiate CPUs separately
>       monitor: add proper reference counting of the current CPU
> 
> 
>  hw/ppc/spapr.c                  |   10 +++-------
>  hw/ppc/spapr_cpu_core.c         |   29 +++++++++--------------------
>  include/hw/ppc/spapr_cpu_core.h |    2 +-
>  monitor.c                       |   12 ++++++++++++
>  4 files changed, 25 insertions(+), 28 deletions(-)
> 


Re: [Qemu-devel] [PATCH 0/2] monitor: increase the refcount of the current CPU
Posted by Greg Kurz 6 years, 6 months ago
On Fri, 13 Oct 2017 10:46:22 +0200
Cornelia Huck <cohuck@redhat.com> wrote:

> On Fri, 13 Oct 2017 10:35:06 +0200
> Greg Kurz <groug@kaod.org> wrote:
> 
> > If a CPU selected with the "cpu" command is hot-unplugged then "info cpus"
> > causes QEMU to exit:
> >     
> > (qemu) device_del cpu1
> > (qemu) info cpus
> > qemu:qemu_cpu_kick_thread: No such process
> > 
> > I could verify that this happens with x86 and ppc, but I guess s390x is
> > also impacted.  
> 
> Not really, as s390x does not support cpu unplug.
> 

I must admit I didn't check. Thanks for telling me. :)

> > 
> > This series tries to fix the issue by using object_ref() and object_unref()
> > in the monitor code. For this to work on ppc, some preliminary work is
> > needed to let QOM handle the CPU object lifecycle.
> > 
> > Please comment.
> > 
> > --
> > Greg
> > 
> > ---
> > 
> > Greg Kurz (2):
> >       spapr_cpu_core: instantiate CPUs separately
> >       monitor: add proper reference counting of the current CPU
> > 
> > 
> >  hw/ppc/spapr.c                  |   10 +++-------
> >  hw/ppc/spapr_cpu_core.c         |   29 +++++++++--------------------
> >  include/hw/ppc/spapr_cpu_core.h |    2 +-
> >  monitor.c                       |   12 ++++++++++++
> >  4 files changed, 25 insertions(+), 28 deletions(-)
> >   
>