qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: ehabkost@redhat.com, aik@ozlabs.ru,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	agraf@suse.de, armbru@redhat.com, pbonzini@redhat.com,
	imammedo@redhat.com, afaerber@suse.de,
	david@gibson.dropbear.id.au
Subject: [Qemu-devel] [RFC PATCH v0 0/8] cpu-package hotplug
Date: Mon, 22 Feb 2016 10:31:17 +0530	[thread overview]
Message-ID: <1456117285-22273-1-git-send-email-bharata@linux.vnet.ibm.com> (raw)

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

             reply	other threads:[~2016-02-22  5:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22  5:01 Bharata B Rao [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456117285-22273-1-git-send-email-bharata@linux.vnet.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=armbru@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).