From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXidm-0001QT-Lr for qemu-devel@nongnu.org; Mon, 22 Feb 2016 00:02:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXidj-0004kf-Ew for qemu-devel@nongnu.org; Mon, 22 Feb 2016 00:02:34 -0500 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:55632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXidi-0004k6-Sx for qemu-devel@nongnu.org; Mon, 22 Feb 2016 00:02:31 -0500 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Feb 2016 15:02:27 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 3BC842BB0045 for ; Mon, 22 Feb 2016 16:02:22 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1M52DP452297924 for ; Mon, 22 Feb 2016 16:02:22 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1M51nfd014284 for ; Mon, 22 Feb 2016 16:01:49 +1100 From: Bharata B Rao Date: Mon, 22 Feb 2016 10:31:17 +0530 Message-Id: <1456117285-22273-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v0 0/8] cpu-package hotplug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ehabkost@redhat.com, aik@ozlabs.ru, Bharata B Rao , agraf@suse.de, armbru@redhat.com, pbonzini@redhat.com, imammedo@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au 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