All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v6 00/11] sPAPR CPU hotplug
@ 2016-01-08  6:55 Bharata B Rao
  2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 01/11] machine: Don't allow CPU toplogies with partially filled cores Bharata B Rao
                   ` (10 more replies)
  0 siblings, 11 replies; 39+ messages in thread
From: Bharata B Rao @ 2016-01-08  6:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: ehabkost, aik, Bharata B Rao, mdroth, agraf, pbonzini, qemu-ppc,
	tyreld, nfont, imammedo, afaerber, david

Hi,

This is the 6th iteration of patchset that introduces CPU hotplug for
PowerPC sPAPR guests using device_add/device_del commands.

(qemu) device_add powerpc64-cpu-core,id=core1

The first 6 patches are generic changes.

1/11  machine: Don't allow CPU toplogies with partially filled cores
2/11  exec: Remove cpu from cpus list during cpu_exec_exit()
3/11  exec: Do vmstate unregistration from cpu_exec_exit()
4/11  cpu: Don't realize CPU from cpu_generic_init()

Above 4 patches can stand on their own and probably can be pushed
ahead of actual hotplug patches when found ready. Let me know if I
should pursue these in a separate patchset.

5/11  cpu: Reclaim vCPU objects

Above patch is needed by x86 as well as s390 and has been posted in their
respective CPU hotplug patchsets.

6/11  cpu: Add a sync version of cpu_remove()

The remaining patches are ppc/spapr specific.

I had posted an RFC on generic cpu-core device in Dec 15.
(https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg01526.html)
While that was an attempt to define common CPU device semantics that
could work for all archs, this patchset continues to pursue the
PowerPC specific semantics.

One aspect that is still missing from this patchset is to expose this arch
sepcific CPU device name in a way that becomes easier for higher
level management tool like libvirt. A patchset addressing this aspect
would benefit x86 and s390 CPU hotplug platchsets as well.

Main changes in v6
------------------
- Instead of creating and realizing SMT threads from main thread's
  plug() routine, I have now created a PowerPC specific CPU core device
  which will create all the threads of the core from its instance_init
  and realize them separately. (10/11)
- The new CPU core device will change the semantics of CPU hotplug.
  Instead of the earlier semantics which had CPU model and CPU type
  name like
  (qemu) device_add POWER8-powerpc64-cpu,id=cpu0
  ,we now have the following semantics to add a core:
  (qemu) device_add powerpc64-cpu-core,id=core1
- Added a patch to remove realization part from cpu_generic_init()
  and moved the realization bit to the callers. (4/11)
- The approach to prevent partially filled cores has been modified based
  on Eduardo's suggestion. (1/11)
- CPUs specified with -smp command line option are created as PowerPC
  specific CPU core device only if CPU hotplug is enabled (pseries-2.6
  and higher). Otherwise they continue to be brought up as individual
  CPU devices as earlier. This allows us to support partially filled
  CPU core configuations w/o the associated ugliness I had in v4. (10/11)
- CPU unplug patch has been reworked to show the core and thread
  unplug routines explicit and clear. (11/11)

Other changes
-------------
- Moved ss->cs handling into xics based on David's review. (7/11)
- Use of iothread unlock instead of global mutex in CPU reclaims patch 
  based on David and Alexey's review. (5/11)
- No need to use DIV_UP when calculating the numbers of cores as we
  are already preventing configurations with partially fileed cores as
  per David's review. (9/11)
- Removed spapr_cpu_init() call from boot time cpus initialization
  as it is now done from ->plug() handler (10/11)
- Enabled CPU hotplug for pseries-2.6 instead of 2.5.

v5: https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04655.html

Bharata B Rao (10):
  machine: Don't allow CPU toplogies with partially filled cores
  exec: Remove cpu from cpus list during cpu_exec_exit()
  exec: Do vmstate unregistration from cpu_exec_exit()
  cpu: Don't realize CPU from cpu_generic_init()
  cpu: Add a sync version of cpu_remove()
  xics,xics_kvm: Handle CPU unplug correctly
  target-ppc: Introduce PowerPC specific CPU core device
  spapr: Enable CPU hotplug for pseries-2.6 and add CPU DRC DT entries
  spapr: CPU hotplug support
  spapr: CPU hot unplug support

Gu Zheng (1):
  cpu: Reclaim vCPU objects

 cpus.c                      |  50 +++++++
 exec.c                      |  30 ++++
 hw/core/machine.c           |  20 +++
 hw/i386/pc_piix.c           |   7 +
 hw/i386/pc_q35.c            |   7 +
 hw/intc/xics.c              |  13 ++
 hw/intc/xics_kvm.c          |   8 +-
 hw/ppc/Makefile.objs        |   1 +
 hw/ppc/cpu-core.c           |  69 ++++++++++
 hw/ppc/spapr.c              | 326 +++++++++++++++++++++++++++++++++++++++++++-
 hw/ppc/spapr_events.c       |   3 +
 hw/ppc/spapr_rtas.c         |  24 ++++
 include/hw/boards.h         |   1 +
 include/hw/ppc/cpu-core.h   |  22 +++
 include/hw/ppc/spapr.h      |  12 ++
 include/hw/ppc/xics.h       |   1 +
 include/qom/cpu.h           |  18 +++
 include/sysemu/kvm.h        |   1 +
 kvm-all.c                   |  57 +++++++-
 kvm-stub.c                  |   5 +
 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 |  24 +++-
 target-sh4/cpu.c            |  16 ++-
 target-tricore/helper.c     |  16 ++-
 target-unicore32/helper.c   |  16 ++-
 vl.c                        |   4 +
 31 files changed, 810 insertions(+), 27 deletions(-)
 create mode 100644 hw/ppc/cpu-core.c
 create mode 100644 include/hw/ppc/cpu-core.h

-- 
2.1.0

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

end of thread, other threads:[~2016-01-27 16:32 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-08  6:55 [Qemu-devel] [PATCH v6 00/11] sPAPR CPU hotplug Bharata B Rao
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 01/11] machine: Don't allow CPU toplogies with partially filled cores Bharata B Rao
2016-01-12  4:03   ` David Gibson
2016-01-12 23:24   ` Alexey Kardashevskiy
2016-01-23 13:47   ` Eduardo Habkost
2016-01-25  8:57     ` Bharata B Rao
2016-01-26 17:47       ` Eduardo Habkost
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 02/11] exec: Remove cpu from cpus list during cpu_exec_exit() Bharata B Rao
2016-01-12  4:06   ` David Gibson
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 03/11] exec: Do vmstate unregistration from cpu_exec_exit() Bharata B Rao
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 04/11] cpu: Don't realize CPU from cpu_generic_init() Bharata B Rao
2016-01-12  4:09   ` David Gibson
2016-01-23 13:31   ` Eduardo Habkost
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 05/11] cpu: Reclaim vCPU objects Bharata B Rao
2016-01-12  4:13   ` David Gibson
2016-01-27 16:31   ` Matthew Rosato
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 06/11] cpu: Add a sync version of cpu_remove() Bharata B Rao
2016-01-12  4:16   ` David Gibson
2016-01-12  6:53     ` Bharata B Rao
2016-01-13  3:45       ` David Gibson
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 07/11] xics, xics_kvm: Handle CPU unplug correctly Bharata B Rao
2016-01-12  4:19   ` David Gibson
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 08/11] target-ppc: Introduce PowerPC specific CPU core device Bharata B Rao
2016-01-12  4:24   ` David Gibson
2016-01-12 23:30   ` Alexey Kardashevskiy
2016-01-12 23:44   ` Alexey Kardashevskiy
2016-01-13  4:30     ` Bharata B Rao
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 09/11] spapr: Enable CPU hotplug for pseries-2.6 and add CPU DRC DT entries Bharata B Rao
2016-01-12  5:41   ` David Gibson
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 10/11] spapr: CPU hotplug support Bharata B Rao
2016-01-12  5:58   ` David Gibson
2016-01-13  3:55     ` Bharata B Rao
2016-01-12 23:58   ` Alexey Kardashevskiy
2016-01-13  4:01     ` Bharata B Rao
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 11/11] spapr: CPU hot unplug support Bharata B Rao
2016-01-12  6:06   ` David Gibson
2016-01-13  4:10     ` Bharata B Rao
2016-01-13  4:57       ` David Gibson
2016-01-13  7:04         ` Bharata B Rao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.