All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627
@ 2016-06-27  5:29 David Gibson
  2016-06-27  5:29 ` [Qemu-devel] [PULL 1/4] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR David Gibson
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: David Gibson @ 2016-06-27  5:29 UTC (permalink / raw)
  To: peter.maydell
  Cc: agraf, imammedo, bharata, pkrempa, qemu-devel, qemu-ppc, David Gibson

The following changes since commit a01aef5d2f96c334d048f43f0d3573a1152b37ca:

  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2016-06-24 11:00:15 +0100)

are available in the git repository at:

  git://github.com/dgibson/qemu.git tags/ppc-for-2.7-20160627

for you to fetch changes up to 27393c33d806a4a5c3bc85342e4c1985a666681b:

  qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore (2016-06-27 13:15:06 +1000)

----------------------------------------------------------------
ppc patch queue for 2016-06-27

Small queue this time.  Main reason for sending it is the pair of
patches to fix up the new cpu hotplug model used on Power to what
should be an actually usable state.  There's also a small BookE bugfix
and a XICS trivial cleanup.

----------------------------------------------------------------
Aaron Larson (1):
      target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR

Benjamin Herrenschmidt (1):
      ppc/xics: Remove unused xics_set_irq_type()

Peter Krempa (2):
      qapi: Report support for -device cpu hotplug in query-machines
      qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore

 hmp.c                 | 16 ++++++++--------
 hw/intc/xics.c        | 11 -----------
 hw/ppc/ppce500_spin.c |  2 +-
 hw/ppc/spapr.c        |  4 ++--
 include/hw/cpu/core.h |  3 +++
 include/hw/ppc/xics.h |  1 -
 qapi-schema.json      | 24 ++++++++++++++----------
 vl.c                  |  1 +
 8 files changed, 29 insertions(+), 33 deletions(-)

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

* [Qemu-devel] [PULL 1/4] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR
  2016-06-27  5:29 [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 David Gibson
@ 2016-06-27  5:29 ` David Gibson
  2016-06-27  5:29 ` [Qemu-devel] [PULL 2/4] ppc/xics: Remove unused xics_set_irq_type() David Gibson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2016-06-27  5:29 UTC (permalink / raw)
  To: peter.maydell
  Cc: agraf, imammedo, bharata, pkrempa, qemu-devel, qemu-ppc,
	Aaron Larson, David Gibson

From: Aaron Larson <alarson@ddci.com>

ppce500_spin.c uses SPR_PIR to initialize the spin table, however on
Book E processors the correct SPR is SPR_BOOKE_PIR.

Signed-off-by: Aaron Larson <alarson@ddci.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/ppce500_spin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c
index 76bd78b..225177b 100644
--- a/hw/ppc/ppce500_spin.c
+++ b/hw/ppc/ppce500_spin.c
@@ -104,7 +104,7 @@ static void spin_kick(void *data)
     hwaddr map_start;
 
     cpu_synchronize_state(cpu);
-    stl_p(&curspin->pir, env->spr[SPR_PIR]);
+    stl_p(&curspin->pir, env->spr[SPR_BOOKE_PIR]);
     env->nip = ldq_p(&curspin->addr) & (map_size - 1);
     env->gpr[3] = ldq_p(&curspin->r3);
     env->gpr[4] = 0;
-- 
2.5.5

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

* [Qemu-devel] [PULL 2/4] ppc/xics: Remove unused xics_set_irq_type()
  2016-06-27  5:29 [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 David Gibson
  2016-06-27  5:29 ` [Qemu-devel] [PULL 1/4] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR David Gibson
@ 2016-06-27  5:29 ` David Gibson
  2016-06-27  5:29 ` [Qemu-devel] [PULL 3/4] qapi: Report support for -device cpu hotplug in query-machines David Gibson
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2016-06-27  5:29 UTC (permalink / raw)
  To: peter.maydell
  Cc: agraf, imammedo, bharata, pkrempa, qemu-devel, qemu-ppc,
	Benjamin Herrenschmidt, Nikunj A Dadhania, David Gibson

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
[dwg: Adjusted for context to apply without original series]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/intc/xics.c        | 11 -----------
 include/hw/ppc/xics.h |  1 -
 2 files changed, 12 deletions(-)

diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index cce7f3d..2e83d41 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -694,17 +694,6 @@ static void ics_set_irq_type(ICSState *ics, int srcno, bool lsi)
         lsi ? XICS_FLAGS_IRQ_LSI : XICS_FLAGS_IRQ_MSI;
 }
 
-void xics_set_irq_type(XICSState *icp, int irq, bool lsi)
-{
-    int src = xics_find_source(icp, irq);
-    ICSState *ics;
-
-    assert(src >= 0);
-
-    ics = &icp->ics[src];
-    ics_set_irq_type(ics, irq - ics->offset, lsi);
-}
-
 #define ICS_IRQ_FREE(ics, srcno)   \
     (!((ics)->irqs[(srcno)].flags & (XICS_FLAGS_IRQ_MASK)))
 
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 9091054..6925677 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -160,7 +160,6 @@ struct ICSIRQState {
 #define XICS_IRQS               1024
 
 qemu_irq xics_get_qirq(XICSState *icp, int irq);
-void xics_set_irq_type(XICSState *icp, int irq, bool lsi);
 int xics_alloc(XICSState *icp, int src, int irq_hint, bool lsi, Error **errp);
 int xics_alloc_block(XICSState *icp, int src, int num, bool lsi, bool align,
                      Error **errp);
-- 
2.5.5

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

* [Qemu-devel] [PULL 3/4] qapi: Report support for -device cpu hotplug in query-machines
  2016-06-27  5:29 [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 David Gibson
  2016-06-27  5:29 ` [Qemu-devel] [PULL 1/4] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR David Gibson
  2016-06-27  5:29 ` [Qemu-devel] [PULL 2/4] ppc/xics: Remove unused xics_set_irq_type() David Gibson
@ 2016-06-27  5:29 ` David Gibson
  2016-06-27  5:29 ` [Qemu-devel] [PULL 4/4] qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore David Gibson
  2016-06-27 14:46 ` [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2016-06-27  5:29 UTC (permalink / raw)
  To: peter.maydell
  Cc: agraf, imammedo, bharata, pkrempa, qemu-devel, qemu-ppc, David Gibson

From: Peter Krempa <pkrempa@redhat.com>

For management apps it's very useful to know whether the selected
machine type supports cpu hotplug via the new -device approach. Using
the presence of 'query-hotpluggable-cpus' alone is not enough as a
witness.

Add a property to 'MachineInfo' called 'hotpluggable-cpus' that will
report the presence of this feature.

Example of output:
    {
        "hotpluggable-cpus": false,
        "name": "mac99",
        "cpu-max": 1
    },
    {
        "hotpluggable-cpus": true,
        "name": "pseries-2.7",
        "is-default": true,
        "cpu-max": 255,
        "alias": "pseries"
    },

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 qapi-schema.json | 5 ++++-
 vl.c             | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/qapi-schema.json b/qapi-schema.json
index 84b6708..a075759 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2986,11 +2986,14 @@
 # @cpu-max: maximum number of CPUs supported by the machine type
 #           (since 1.5.0)
 #
+# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
+#
 # Since: 1.2.0
 ##
 { 'struct': 'MachineInfo',
   'data': { 'name': 'str', '*alias': 'str',
-            '*is-default': 'bool', 'cpu-max': 'int' } }
+            '*is-default': 'bool', 'cpu-max': 'int',
+            'hotpluggable-cpus': 'bool'} }
 
 ##
 # @query-machines:
diff --git a/vl.c b/vl.c
index c85833a..4c1f9ae 100644
--- a/vl.c
+++ b/vl.c
@@ -1524,6 +1524,7 @@ MachineInfoList *qmp_query_machines(Error **errp)
 
         info->name = g_strdup(mc->name);
         info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
+        info->hotpluggable_cpus = !!mc->query_hotpluggable_cpus;
 
         entry = g_malloc0(sizeof(*entry));
         entry->value = info;
-- 
2.5.5

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

* [Qemu-devel] [PULL 4/4] qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore
  2016-06-27  5:29 [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 David Gibson
                   ` (2 preceding siblings ...)
  2016-06-27  5:29 ` [Qemu-devel] [PULL 3/4] qapi: Report support for -device cpu hotplug in query-machines David Gibson
@ 2016-06-27  5:29 ` David Gibson
  2016-06-27 14:46 ` [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2016-06-27  5:29 UTC (permalink / raw)
  To: peter.maydell
  Cc: agraf, imammedo, bharata, pkrempa, qemu-devel, qemu-ppc, David Gibson

From: Peter Krempa <pkrempa@redhat.com>

struct CPUCore uses 'id' suffix in the property name. As docs for
query-hotpluggable-cpus state that the cpu core properties should be
passed back to device_add by management in case new members are added
and thus the names for the fields should be kept in sync.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
[dwg: Removed a duplicated word in comment]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hmp.c                 | 16 ++++++++--------
 hw/ppc/spapr.c        |  4 ++--
 include/hw/cpu/core.h |  3 +++
 qapi-schema.json      | 19 ++++++++++---------
 4 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/hmp.c b/hmp.c
index 997a768..925601a 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2457,17 +2457,17 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
 
         c = l->value->props;
         monitor_printf(mon, "  CPUInstance Properties:\n");
-        if (c->has_node) {
-            monitor_printf(mon, "    node: \"%" PRIu64 "\"\n", c->node);
+        if (c->has_node_id) {
+            monitor_printf(mon, "    node-id: \"%" PRIu64 "\"\n", c->node_id);
         }
-        if (c->has_socket) {
-            monitor_printf(mon, "    socket: \"%" PRIu64 "\"\n", c->socket);
+        if (c->has_socket_id) {
+            monitor_printf(mon, "    socket-id: \"%" PRIu64 "\"\n", c->socket_id);
         }
-        if (c->has_core) {
-            monitor_printf(mon, "    core: \"%" PRIu64 "\"\n", c->core);
+        if (c->has_core_id) {
+            monitor_printf(mon, "    core-id: \"%" PRIu64 "\"\n", c->core_id);
         }
-        if (c->has_thread) {
-            monitor_printf(mon, "    thread: \"%" PRIu64 "\"\n", c->thread);
+        if (c->has_thread_id) {
+            monitor_printf(mon, "    thread-id: \"%" PRIu64 "\"\n", c->thread_id);
         }
 
         l = l->next;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 778fa25..0b6bb9c 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2367,8 +2367,8 @@ static HotpluggableCPUList *spapr_query_hotpluggable_cpus(MachineState *machine)
 
         cpu_item->type = spapr_get_cpu_core_type(machine->cpu_model);
         cpu_item->vcpus_count = smp_threads;
-        cpu_props->has_core = true;
-        cpu_props->core = i * smt;
+        cpu_props->has_core_id = true;
+        cpu_props->core_id = i * smt;
         /* TODO: add 'has_node/node' here to describe
            to which node core belongs */
 
diff --git a/include/hw/cpu/core.h b/include/hw/cpu/core.h
index 4540a7d..79ac79c 100644
--- a/include/hw/cpu/core.h
+++ b/include/hw/cpu/core.h
@@ -26,6 +26,9 @@ typedef struct CPUCore {
     int nr_threads;
 } CPUCore;
 
+/* Note: topology field names need to be kept in sync with
+ * 'CpuInstanceProperties' */
+
 #define CPU_CORE_PROP_CORE_ID "core-id"
 
 #endif
diff --git a/qapi-schema.json b/qapi-schema.json
index a075759..ba3bf14 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4268,20 +4268,21 @@
 # Note: currently there are 4 properties that could be present
 # but management should be prepared to pass through other
 # properties with device_add command to allow for future
-# interface extension.
+# interface extension. This also requires the filed names to be kept in
+# sync with the properties passed to -device/device_add.
 #
-# @node: #optional NUMA node ID the CPU belongs to
-# @socket: #optional socket number within node/board the CPU belongs to
-# @core: #optional core number within socket the CPU belongs to
-# @thread: #optional thread number within core the CPU belongs to
+# @node-id: #optional NUMA node ID the CPU belongs to
+# @socket-id: #optional socket number within node/board the CPU belongs to
+# @core-id: #optional core number within socket the CPU belongs to
+# @thread-id: #optional thread number within core the CPU belongs to
 #
 # Since: 2.7
 ##
 { 'struct': 'CpuInstanceProperties',
-  'data': { '*node': 'int',
-            '*socket': 'int',
-            '*core': 'int',
-            '*thread': 'int'
+  'data': { '*node-id': 'int',
+            '*socket-id': 'int',
+            '*core-id': 'int',
+            '*thread-id': 'int'
   }
 }
 
-- 
2.5.5

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

* Re: [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627
  2016-06-27  5:29 [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 David Gibson
                   ` (3 preceding siblings ...)
  2016-06-27  5:29 ` [Qemu-devel] [PULL 4/4] qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore David Gibson
@ 2016-06-27 14:46 ` Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2016-06-27 14:46 UTC (permalink / raw)
  To: David Gibson
  Cc: Alexander Graf, Igor Mammedov, bharata, pkrempa, QEMU Developers,
	qemu-ppc

On 27 June 2016 at 06:29, David Gibson <david@gibson.dropbear.id.au> wrote:
> The following changes since commit a01aef5d2f96c334d048f43f0d3573a1152b37ca:
>
>   Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2016-06-24 11:00:15 +0100)
>
> are available in the git repository at:
>
>   git://github.com/dgibson/qemu.git tags/ppc-for-2.7-20160627
>
> for you to fetch changes up to 27393c33d806a4a5c3bc85342e4c1985a666681b:
>
>   qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore (2016-06-27 13:15:06 +1000)
>
> ----------------------------------------------------------------
> ppc patch queue for 2016-06-27
>
> Small queue this time.  Main reason for sending it is the pair of
> patches to fix up the new cpu hotplug model used on Power to what
> should be an actually usable state.  There's also a small BookE bugfix
> and a XICS trivial cleanup.
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2016-06-27 14:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-27  5:29 [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 David Gibson
2016-06-27  5:29 ` [Qemu-devel] [PULL 1/4] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR David Gibson
2016-06-27  5:29 ` [Qemu-devel] [PULL 2/4] ppc/xics: Remove unused xics_set_irq_type() David Gibson
2016-06-27  5:29 ` [Qemu-devel] [PULL 3/4] qapi: Report support for -device cpu hotplug in query-machines David Gibson
2016-06-27  5:29 ` [Qemu-devel] [PULL 4/4] qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore David Gibson
2016-06-27 14:46 ` [Qemu-devel] [PULL 0/4] ppc-for-2.7 queue 20160627 Peter Maydell

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.