Hi, This is v3 of "Core based CPU hotplug for PowerPC sPAPR". The hotplug semantics looks like this:
(qemu) device_add POWER8E-spapr-cpu-core,id=core2,core=16[,threads=4] (qemu) device_add POWER8E_v2.1-spapr-cpu-core,id=core2,core=16[,threads=4] Changes in v3 ------------- - Moved CPU ObjectClass pointer from sPAPR specific CPU core type to its parent type, the abstract sPAPR CPU core type. This largely reduces the use of macros. - Including Igor's QMP query-hotpluggable-cpus patches in this series. - Added HMP version for query-hotpluggable-cpus. - Added a patch to prevent QEMU crash due to DRC detach racing against attach. - Addressed miscellaneous review comments from previous post. v2.1: https://lists.gnu.org/archive/html/qemu-ppc/2016-03/msg00649.html Bharata B Rao (11): exec: Remove cpu from cpus list during cpu_exec_exit() exec: Do vmstate unregistration from cpu_exec_exit() cpu: Add a sync version of cpu_remove() cpu: Abstract CPU core type spapr: Abstract CPU core device and type specific core devices spapr: convert boot CPUs into CPU core devices spapr: CPU hotplug support xics,xics_kvm: Handle CPU unplug correctly spapr_drc: Prevent detach racing against attach for CPU DR spapr: CPU hot unplug support hmp: Add 'info hotpluggable-cpus' HMP command Gu Zheng (1): cpu: Reclaim vCPU objects Igor Mammedov (3): qdev: hotplug: Introduce HotplugHandler.pre_plug() callback QMP: Add query-hotpluggable-cpus spapr: implement query-hotpluggable-cpus callback cpus.c | 51 +++++- exec.c | 41 ++++- hmp-commands-info.hx | 14 ++ hmp.c | 41 +++++ hmp.h | 1 + hw/core/hotplug.c | 11 ++ hw/core/qdev.c | 9 +- hw/cpu/Makefile.objs | 1 + hw/cpu/core.c | 88 ++++++++++ hw/intc/xics.c | 14 ++ hw/intc/xics_kvm.c | 8 +- hw/ppc/Makefile.objs | 1 + hw/ppc/spapr.c | 190 ++++++++++++++++++-- hw/ppc/spapr_cpu_core.c | 376 ++++++++++++++++++++++++++++++++++++++++ hw/ppc/spapr_drc.c | 12 ++ hw/ppc/spapr_events.c | 3 + hw/ppc/spapr_rtas.c | 24 +++ include/hw/boards.h | 5 + include/hw/cpu/core.h | 31 ++++ include/hw/hotplug.h | 14 +- include/hw/ppc/spapr.h | 6 + include/hw/ppc/spapr_cpu_core.h | 44 +++++ include/hw/ppc/spapr_drc.h | 1 + include/hw/ppc/xics.h | 1 + include/qom/cpu.h | 18 ++ include/sysemu/kvm.h | 1 + kvm-all.c | 57 +++++- kvm-stub.c | 5 + monitor.c | 13 ++ qapi-schema.json | 55 ++++++ qmp-commands.hx | 23 +++ 31 files changed, 1130 insertions(+), 29 deletions(-) create mode 100644 hw/cpu/core.c create mode 100644 hw/ppc/spapr_cpu_core.c create mode 100644 include/hw/cpu/core.h create mode 100644 include/hw/ppc/spapr_cpu_core.h -- 2.1.0