qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH v0 0/8] cpu-package hotplug
@ 2016-02-22  5:01 Bharata B Rao
  2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 1/8] cpu: Store CPU typename in MachineState Bharata B Rao
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Bharata B Rao @ 2016-02-22  5:01 UTC (permalink / raw)
  To: qemu-devel
  Cc: ehabkost, aik, Bharata B Rao, agraf, armbru, pbonzini, imammedo,
	afaerber, david

Hi,

This is an attempt to implement David Gibson's RFC that was posted at
https://lists.gnu.org/archive/html/qemu-ppc/2016-02/msg00000.html
I am not sure if I have followed all the aspects of the RFC fully, but we
can make changes going forward.

An example cpu-package implementation is done for sPAPR in this patchset.
Hot removal is not yet done in this patchset.

For the command line,

-smp 8,sockets=1,cores=1,threads=8,maxcpus=16 -numa node,nodeid=0,cpus=0-7 -numa node,nodeid=1,cpus=8-15

the HMP query looks like this:

(qemu) info cpu-packages 
CPU Package: ""
  type: "spapr-cpu-package"
  qom_path: "/machine/cpu-package[0]"
  realized: true
  nr_cpus: 8
  CPU: 0
    Type: "host-powerpc64-cpu"
    Arch ID: 0
    Thread: 0
    Core: 0
    Socket: 0
    Node: 0
  CPU: 1
    Type: "host-powerpc64-cpu"
    Arch ID: 1
    Thread: 1
    Core: 0
    Socket: 0
    Node: 0
  CPU: 2
    Type: "host-powerpc64-cpu"
    Arch ID: 2
    Thread: 2
    Core: 0
    Socket: 0
    Node: 0
  CPU: 3
    Type: "host-powerpc64-cpu"
    Arch ID: 3
    Thread: 3
    Core: 0
    Socket: 0
    Node: 0
  CPU: 4
    Type: "host-powerpc64-cpu"
    Arch ID: 4
    Thread: 4
    Core: 0
    Socket: 0
    Node: 0
  CPU: 5
    Type: "host-powerpc64-cpu"
    Arch ID: 5
    Thread: 5
    Core: 0
    Socket: 0
    Node: 0
  CPU: 6
    Type: "host-powerpc64-cpu"
    Arch ID: 6
    Thread: 6
    Core: 0
    Socket: 0
    Node: 0
  CPU: 7
    Type: "host-powerpc64-cpu"
    Arch ID: 7
    Thread: 7
    Core: 0
    Socket: 0
    Node: 0
CPU Package: ""
  type: "spapr-cpu-package"
  qom_path: "/machine/cpu-package[1]"
  realized: false
  nr_cpus: 8

As can be seen from above, all the cores upto max_cpus are created upfront
here and hot plug is done in the following manner:

(qemu) qom-set /machine/cpu-package[1] realized true

This will result in the 2nd cpu-package consisting of a core with 8 threads
to become available.

I am not fully sure if the QMP emumeration here works for all archs, but
just wanted to share what I currently.

Bharata B Rao (8):
  cpu: Store CPU typename in MachineState
  cpu: Don't realize CPU from cpu_generic_init()
  cpu: CPU package abstract device
  spapr: Introduce CPU core device
  spapr: Convert boot CPUs into CPU core device initialization
  spapr: CPU hotplug support
  qmp: Implement query cpu-packages
  hmp: Implement 'info cpu-slots'

 hmp-commands-info.hx               |  14 +++
 hmp.c                              |  50 ++++++++
 hmp.h                              |   1 +
 hw/cpu/Makefile.objs               |   1 +
 hw/cpu/package.c                   |  85 +++++++++++++
 hw/ppc/Makefile.objs               |   1 +
 hw/ppc/spapr.c                     | 246 +++++++++++++++++++++++++++++++++++--
 hw/ppc/spapr_cpu_package.c         |  50 ++++++++
 hw/ppc/spapr_events.c              |   3 +
 hw/ppc/spapr_rtas.c                |  24 ++++
 include/hw/boards.h                |   2 +
 include/hw/cpu/package.h           |  27 ++++
 include/hw/ppc/spapr.h             |   1 +
 include/hw/ppc/spapr_cpu_package.h |  27 ++++
 qapi-schema.json                   |  48 ++++++++
 qom/cpu.c                          |   6 -
 target-arm/helper.c                |  16 ++-
 target-cris/cpu.c                  |  16 ++-
 target-lm32/helper.c               |  16 ++-
 target-moxie/cpu.c                 |  16 ++-
 target-openrisc/cpu.c              |  16 ++-
 target-ppc/translate_init.c        |  16 ++-
 target-sh4/cpu.c                   |  16 ++-
 target-tricore/helper.c            |  16 ++-
 target-unicore32/helper.c          |  16 ++-
 25 files changed, 707 insertions(+), 23 deletions(-)
 create mode 100644 hw/cpu/package.c
 create mode 100644 hw/ppc/spapr_cpu_package.c
 create mode 100644 include/hw/cpu/package.h
 create mode 100644 include/hw/ppc/spapr_cpu_package.h

-- 
2.1.0

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-02-23  8:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-22  5:01 [Qemu-devel] [RFC PATCH v0 0/8] cpu-package hotplug Bharata B Rao
2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 1/8] cpu: Store CPU typename in MachineState Bharata B Rao
2016-02-22  8:04   ` David Gibson
2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 2/8] cpu: Don't realize CPU from cpu_generic_init() Bharata B Rao
2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 3/8] cpu: CPU package abstract device Bharata B Rao
2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 4/8] spapr: Introduce CPU core device Bharata B Rao
2016-02-22  6:44   ` Andreas Färber
2016-02-22  7:47     ` David Gibson
2016-02-22 15:58       ` Andreas Färber
2016-02-22 23:24         ` David Gibson
2016-02-22  8:05     ` Bharata B Rao
2016-02-22 15:48       ` Andreas Färber
2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 5/8] spapr: Convert boot CPUs into CPU core device initialization Bharata B Rao
2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 6/8] spapr: CPU hotplug support Bharata B Rao
2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 7/8] qmp: Implement query cpu-packages Bharata B Rao
2016-02-22 16:49   ` Eric Blake
2016-02-23  8:37     ` Igor Mammedov
2016-02-22  5:01 ` [Qemu-devel] [RFC PATCH v0 8/8] hmp: Implement 'info cpu-slots' Bharata B Rao
2016-02-22  5:10 ` [Qemu-devel] [RFC PATCH v0 0/8] cpu-package hotplug Bharata B Rao
2016-02-22 15:32 ` Andreas Färber
2016-02-22 23:28   ` David Gibson
2016-02-23  6:11   ` Bharata B Rao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).