All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Cc: "David Gibson" <david@gibson.dropbear.id.au>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: [Qemu-devel] [PATCH v3 11/35] spapr: introduce a 'xive_exploitation' option to enable XIVE
Date: Thu, 19 Apr 2018 14:43:07 +0200	[thread overview]
Message-ID: <20180419124331.3915-12-clg@kaod.org> (raw)
In-Reply-To: <20180419124331.3915-1-clg@kaod.org>

Also provide a 'both' option to activate both interrupt mode: XIVE
exploitation and legacy (XICS).

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 Changes since v2 :

 - changed the option to a string : "both|off|on"
 - option is not enabled by default anymore. To be discussed.

 hw/ppc/spapr.c         | 41 +++++++++++++++++++++++++++++++++++++++++
 include/hw/ppc/spapr.h |  1 +
 2 files changed, 42 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a81570e7c8b1..b459c0076792 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2907,6 +2907,39 @@ static void spapr_set_vsmt(Object *obj, Visitor *v, const char *name,
     visit_type_uint32(v, name, (uint32_t *)opaque, errp);
 }
 
+static char *spapr_get_xive_exploitation(Object *obj, Error **errp)
+{
+    sPAPRMachineState *spapr = SPAPR_MACHINE(obj);
+
+    switch (spapr->xive_exploitation) {
+    case 0x80:
+        return g_strdup("both");
+    case 0x40:
+        return g_strdup("on");
+    case 0x0:
+        return g_strdup("off");
+    }
+    g_assert_not_reached();
+}
+
+static void spapr_set_xive_exploitation(Object *obj, const char *value,
+                                        Error **errp)
+{
+    sPAPRMachineState *spapr = SPAPR_MACHINE(obj);
+
+    /* TODO: Don't let older machines activate XIVE */
+
+    if (strcmp(value, "both") == 0) {
+        spapr->xive_exploitation = 0x80;
+    } else if (strcmp(value, "on") == 0) {
+        spapr->xive_exploitation = 0x40;
+    } else if (strcmp(value, "off") == 0) {
+        spapr->xive_exploitation = 0;
+    } else {
+        error_setg(errp, "Bad value for \"xive-exploitation\" property");
+    }
+}
+
 static void spapr_instance_init(Object *obj)
 {
     sPAPRMachineState *spapr = SPAPR_MACHINE(obj);
@@ -2944,6 +2977,14 @@ static void spapr_instance_init(Object *obj)
                                     " the host's SMT mode", &error_abort);
     object_property_add_bool(obj, "vfio-no-msix-emulation",
                              spapr_get_msix_emulation, NULL, NULL);
+    spapr->xive_exploitation = false;
+    object_property_add_str(obj, "xive-exploitation",
+                            spapr_get_xive_exploitation,
+                            spapr_set_xive_exploitation,
+                            NULL);
+    object_property_set_description(obj, "xive-exploitation",
+                                    "XIVE exploitation mode POWER9",
+                                    NULL);
 }
 
 static void spapr_machine_finalizefn(Object *obj)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index d60b7c6d7a8b..3f8980310492 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -165,6 +165,7 @@ struct sPAPRMachineState {
     MemoryHotplugState hotplug_memory;
 
     const char *icp_type;
+    uint8_t xive_exploitation;
 
     bool cmd_line_caps[SPAPR_CAP_NUM];
     sPAPRCapabilities def, eff, mig;
-- 
2.13.6

  parent reply	other threads:[~2018-04-19 12:44 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 12:42 [Qemu-devel] [PATCH v3 00/35] ppc: support for the XIVE interrupt controller (POWER9) Cédric Le Goater
2018-04-19 12:42 ` [Qemu-devel] [PATCH v3 01/35] ppc/xive: introduce a XIVE interrupt source model Cédric Le Goater
2018-04-20  7:10   ` David Gibson
2018-04-20  8:27     ` Cédric Le Goater
2018-04-23  3:59       ` David Gibson
2018-04-23  7:11         ` Cédric Le Goater
2018-04-24  1:24           ` David Gibson
2018-04-19 12:42 ` [Qemu-devel] [PATCH v3 02/35] ppc/xive: add support for the LSI interrupt sources Cédric Le Goater
2018-04-23  6:44   ` David Gibson
2018-04-23  7:31     ` Cédric Le Goater
2018-04-24  6:41       ` David Gibson
2018-04-24  8:11         ` Cédric Le Goater
2018-04-26  3:28           ` David Gibson
2018-04-26 12:16             ` Cédric Le Goater
2018-04-27  2:43               ` David Gibson
2018-05-04 14:25                 ` Cédric Le Goater
2018-05-05  4:32                   ` David Gibson
2018-04-19 12:42 ` [Qemu-devel] [PATCH v3 03/35] ppc/xive: introduce the XiveFabric interface Cédric Le Goater
2018-04-23  6:46   ` David Gibson
2018-04-23  7:58     ` Cédric Le Goater
2018-04-24  6:46       ` David Gibson
2018-04-24  9:33         ` Cédric Le Goater
2018-04-26  3:54           ` David Gibson
2018-04-26 10:30             ` Cédric Le Goater
2018-04-27  6:32               ` David Gibson
2018-05-02 15:28                 ` Cédric Le Goater
2018-05-03  5:13                   ` David Gibson
2018-05-23 10:12                     ` Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 04/35] spapr/xive: introduce a XIVE interrupt controller for sPAPR Cédric Le Goater
2018-04-24  6:51   ` David Gibson
2018-04-24  9:46     ` Cédric Le Goater
2018-04-26  4:20       ` David Gibson
2018-04-26 10:43         ` Cédric Le Goater
2018-05-03  5:22           ` David Gibson
2018-05-03 16:50             ` Cédric Le Goater
2018-05-04  3:33               ` David Gibson
2018-05-04 13:05                 ` Cédric Le Goater
2018-05-05  4:26                   ` David Gibson
2018-05-09  7:23                     ` Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 05/35] spapr/xive: add a single source block to the sPAPR XIVE model Cédric Le Goater
2018-04-24  6:58   ` David Gibson
2018-04-24  8:19     ` Cédric Le Goater
2018-04-26  4:46       ` David Gibson
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 06/35] spapr/xive: introduce a XIVE interrupt presenter model Cédric Le Goater
2018-04-26  7:11   ` David Gibson
2018-04-26  9:27     ` Cédric Le Goater
2018-04-26 17:15       ` Cédric Le Goater
2018-05-03  5:39         ` David Gibson
2018-05-03 15:10           ` Cédric Le Goater
2018-05-04  4:44             ` David Gibson
2018-05-04 14:15               ` Cédric Le Goater
2018-05-03  5:35       ` David Gibson
2018-05-03 16:06         ` Cédric Le Goater
2018-05-04  4:51           ` David Gibson
2018-05-04 13:11             ` Cédric Le Goater
2018-05-05  4:27               ` David Gibson
2018-05-09  7:27                 ` Cédric Le Goater
2018-05-02  7:39     ` Cédric Le Goater
2018-05-03  5:43       ` David Gibson
2018-05-03 14:42         ` Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 07/35] spapr/xive: introduce the XIVE Event Queues Cédric Le Goater
2018-04-26  7:25   ` David Gibson
2018-04-26  9:48     ` Cédric Le Goater
2018-05-03  5:45       ` David Gibson
2018-05-03  6:07         ` Cédric Le Goater
2018-05-03  6:25           ` David Gibson
2018-05-03 14:37             ` Cédric Le Goater
2018-05-04  5:19               ` David Gibson
2018-05-04 13:29                 ` Cédric Le Goater
2018-05-05  4:29                   ` David Gibson
2018-05-09  8:01                     ` Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 08/35] spapr: push the XIVE EQ data in OS event queue Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 09/35] spapr: notify the CPU when the XIVE interrupt priority is more privileged Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 10/35] spapr: add support for the SET_OS_PENDING command (XIVE) Cédric Le Goater
2018-04-19 12:43 ` Cédric Le Goater [this message]
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 12/35] spapr: add a sPAPRXive object to the machine Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 13/35] spapr: add hcalls support for the XIVE exploitation interrupt mode Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 14/35] spapr: add device tree support for the XIVE exploitation mode Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 15/35] sysbus: add a sysbus_mmio_unmap() helper Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 16/35] spapr: introduce a helper to map the XIVE memory regions Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 17/35] spapr: add XIVE support to spapr_qirq() Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 18/35] spapr: introduce a spapr_icp_create() helper Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 19/35] spapr: toggle the ICP depending on the selected interrupt mode Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 20/35] spapr: add support to dump XIVE information Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 21/35] spapr: advertise XIVE exploitation mode in CAS Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 22/35] spapr: add classes for the XIVE models Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 23/35] target/ppc/kvm: add Linux KVM definitions for XIVE Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 24/35] spapr/xive: add common realize routine for KVM Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 25/35] spapr/xive: add KVM support Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 26/35] spapr/xive: add a XIVE KVM device to the machine Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 27/35] migration: discard non-migratable RAMBlocks Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 28/35] intc: introduce a CPUIntc interface Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 29/35] spapr/xive, xics: use the CPU_INTC handlers to reset KVM Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 30/35] spapr/xive, xics: reset KVM at machine reset Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 31/35] spapr/xive: raise migration priority of the machine Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 32/35] ppc/pnv: introduce a pnv_icp_create() helper Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 33/35] ppc: externalize ppc_get_vcpu_by_pir() Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 34/35] ppc/pnv: add XIVE support Cédric Le Goater
2018-04-19 12:43 ` [Qemu-devel] [PATCH v3 35/35] ppc/pnv: add a PSI bridge model for POWER9 processor Cédric Le Goater
2018-04-19 13:28 ` [Qemu-devel] [PATCH v3 00/35] ppc: support for the XIVE interrupt controller (POWER9) no-reply

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=20180419124331.3915-12-clg@kaod.org \
    --to=clg@kaod.org \
    --cc=benh@kernel.crashing.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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.