qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/25] spapr: Guest exploitation of the XIVE interrupt controller (POWER9)
@ 2017-11-23 13:29 Cédric Le Goater
  2017-11-23 13:29 ` [Qemu-devel] [PATCH 01/25] ppc/xics: introduce an icp_create() helper Cédric Le Goater
                   ` (24 more replies)
  0 siblings, 25 replies; 128+ messages in thread
From: Cédric Le Goater @ 2017-11-23 13:29 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel, David Gibson, Benjamin Herrenschmidt
  Cc: Cédric Le Goater

Hello,

On a POWER9 sPAPR machine, the Client Architecture Support (CAS)
negotiation process determines whether the guest operates with an
interrupt controller using the XICS legacy model, as found on POWER8,
or in XIVE exploitation mode, the newer POWER9 interrupt model. XIVE
is a complex interrupt controller introducing a large number of new
features, for virtualization in particular. Here is a brief overview
for the sPAPR platform which only requires a small subset of these
functions.

XIVE uses a set of internal tables to redirect exceptions from
interrupt sources to the CPU. Each interrupt source has a 2-bit state
machine, the Event State Buffer (ESB), that allows events to be
triggered. If the event is let through, XIVE looks up in the Interrupt
Virtualization Entry (IVE) table for the Event Queue Descriptor
defined for the source. Each Event Queue Descriptor defines a
notification path to a CPU and an in-memory queue in which will be
recorded an event identifier for the OS to pull.


This patchset is the first non-RFC proposal to add XIVE support in a
POWER9 sPAPR machine. It should addressed the comments made on the
previous RFCs, the most important points being :

 - use a single IRQ allocator for the machine,
 - remove any relation with the XICS model,
 - get rid of 'nr_servers' under the XIVE object. 

The high level ideas of the current design are :

 - move all IRQ allocation code under the machine to make sure that
   the allocated IRQ numbers are kept in sync between XICS and
   XIVE. This is necessary for the devices which allocate IRQs and
   populate the device tree before the machine is even started.

 - introduce a persistent XIVE object under the sPAPR machine and let
   the CAS negotiation process decide whether it should be used or
   not. Use the 'ov5_cas' attribute for this purpose.

 - introduce a persistent XIVE interrupt presenter under the sPAPR
   core and switch ICP after CAS. Each core has now two ICPs, one
   active through the 'intc' pointer and another one among its
   children ready to be used if the guest requires it.

 - move the XIVE EQs under the cores to simplify the XIVE model

 - allocate the CPU IPIs at the beginning of the IRQ number space to
   be compatible with XICS (which starts at 4096) and also to simplify
   the model. This means that the XIVE model covers the whole IRQ
   number space. There are no offset like in XICS splitting the IRQ
   number space.


The patchset first begins with cleanups and code movements in the XICS
model and in the sPAPR machine to prepare ground for the integration
of the XIVE model. Some could be merged directly.

It continues with patches introducing new models or XIVE :

 - sPAPRXive holding the internal tables and the MMIO regions used by
   the XIVE controller.
 - sPAPRXiveICP object acting the XIVE interrupt presenter

and describing the notification process and the interrupt delivery to
the CPU.

It finishes with the integration of sPAPRXive object under the sPAPR
machine, the introducion of the new XIVE hcalls, the new device tree
layout, and the necessary adjustments to support the CAS negotiation.

Migration is addressed, CPU hotplug, and support for older machines
and QEMU versions also.


Code is here:

  https://github.com/legoater/qemu/commits/xive

Caveats :

 - KVM support : not addressed yet
   The guest needs to be run with kernel_irqchip=off on a POWER9 system.
 - LSI : hardly tested.
   
Thanks,

C.

Tests :

 - make check on each patch
 - migration :
     qemu-2.12 (pseries-2.12) <->  qemu-2.12 (pseries-2.12)
     qemu-2.12 (pseries-2.10) <->  qemu-2.12 (pseries-2.10)
     qemu-2.10 (pseries-2.10) <->  qemu-2.12 (pseries-2.10)

Cédric Le Goater (25):
  ppc/xics: introduce an icp_create() helper
  ppc/xics: assign of the CPU 'intc' pointer under the core
  spapr: introduce a spapr_icp_create() helper
  spapr: move the IRQ allocation routines under the machine
  spapr: introduce a spapr_irq_set() helper
  spapr: introduce a spapr_irq_get_qirq() helper
  migration: add VMSTATE_STRUCT_VARRAY_UINT32_ALLOC
  spapr: introduce a skeleton for the XIVE interrupt controller
  spapr: introduce handlers for XIVE interrupt sources
  spapr: add MMIO handlers for the XIVE interrupt sources
  spapr: describe the XIVE interrupt source flags
  spapr: introduce a XIVE interrupt presenter model
  spapr: introduce the XIVE Event Queues
  spapr: push the XIVE EQ data in OS event queue
  spapr: notify the CPU when the XIVE interrupt priority is more
    privileged
  spapr: add support for the SET_OS_PENDING command (XIVE)
  spapr: add a sPAPRXive object to the machine
  spapr: allocate IRQ numbers for the XIVE interrupt mode
  spapr: add hcalls support for the XIVE interrupt mode
  spapr: add device tree support for the XIVE interrupt mode
  spapr: introduce a helper to map the XIVE memory regions
  spapr: add XIVE support to spapr_irq_get_qirq()
  spapr: toggle the ICP depending on the selected interrupt mode
  spapr: add support to dump XIVE information
  spapr: advertise XIVE exploitation mode in CAS

 default-configs/ppc64-softmmu.mak |   1 +
 hw/intc/Makefile.objs             |   1 +
 hw/intc/spapr_xive.c              | 964 ++++++++++++++++++++++++++++++++++++++
 hw/intc/spapr_xive_hcall.c        | 949 +++++++++++++++++++++++++++++++++++++
 hw/intc/trace-events              |   4 -
 hw/intc/xics.c                    |  35 +-
 hw/intc/xics_spapr.c              | 114 -----
 hw/intc/xive-internal.h           | 189 ++++++++
 hw/ppc/pnv_core.c                 |  10 +-
 hw/ppc/spapr.c                    | 286 ++++++++++-
 hw/ppc/spapr_cpu_core.c           |  44 +-
 hw/ppc/spapr_events.c             |  16 +-
 hw/ppc/spapr_hcall.c              |   6 +
 hw/ppc/spapr_pci.c                |  10 +-
 hw/ppc/spapr_vio.c                |   2 +-
 hw/ppc/trace-events               |   4 +
 include/hw/pci-host/spapr.h       |   2 +-
 include/hw/ppc/spapr.h            |  27 +-
 include/hw/ppc/spapr_cpu_core.h   |   1 +
 include/hw/ppc/spapr_vio.h        |   2 +-
 include/hw/ppc/spapr_xive.h       |  89 ++++
 include/hw/ppc/xics.h             |   8 +-
 include/migration/vmstate.h       |  10 +
 23 files changed, 2592 insertions(+), 182 deletions(-)
 create mode 100644 hw/intc/spapr_xive.c
 create mode 100644 hw/intc/spapr_xive_hcall.c
 create mode 100644 hw/intc/xive-internal.h
 create mode 100644 include/hw/ppc/spapr_xive.h

-- 
2.13.6

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

end of thread, other threads:[~2017-12-07 11:55 UTC | newest]

Thread overview: 128+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-23 13:29 [Qemu-devel] [PATCH 00/25] spapr: Guest exploitation of the XIVE interrupt controller (POWER9) Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 01/25] ppc/xics: introduce an icp_create() helper Cédric Le Goater
2017-11-24  2:51   ` David Gibson
2017-11-24  7:57     ` Cédric Le Goater
2017-11-24  9:55     ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-11-27  7:20       ` David Gibson
2017-11-24  9:08   ` Greg Kurz
2017-11-23 13:29 ` [Qemu-devel] [PATCH 02/25] ppc/xics: assign of the CPU 'intc' pointer under the core Cédric Le Goater
2017-11-24  2:57   ` David Gibson
2017-11-24  9:21   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-11-23 13:29 ` [Qemu-devel] [PATCH 03/25] spapr: introduce a spapr_icp_create() helper Cédric Le Goater
2017-11-24 10:09   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-11-24 12:26     ` Cédric Le Goater
2017-11-28 10:56       ` Greg Kurz
2017-11-23 13:29 ` [Qemu-devel] [PATCH 04/25] spapr: move the IRQ allocation routines under the machine Cédric Le Goater
2017-11-24  3:13   ` David Gibson
2017-11-28 10:57   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-11-23 13:29 ` [Qemu-devel] [PATCH 05/25] spapr: introduce a spapr_irq_set() helper Cédric Le Goater
2017-11-24  3:16   ` David Gibson
2017-11-24  8:32     ` Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 06/25] spapr: introduce a spapr_irq_get_qirq() helper Cédric Le Goater
2017-11-24  3:18   ` David Gibson
2017-11-24  8:01     ` Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 07/25] migration: add VMSTATE_STRUCT_VARRAY_UINT32_ALLOC Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 08/25] spapr: introduce a skeleton for the XIVE interrupt controller Cédric Le Goater
2017-11-28  5:40   ` David Gibson
2017-11-28 10:44     ` Cédric Le Goater
2017-11-29  4:47       ` David Gibson
2017-11-29 11:49   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-11-29 13:46     ` Cédric Le Goater
2017-11-29 15:51       ` Greg Kurz
2017-11-29 16:41         ` Cédric Le Goater
2017-11-30  4:23       ` David Gibson
2017-11-30  4:22     ` David Gibson
2017-11-23 13:29 ` [Qemu-devel] [PATCH 09/25] spapr: introduce handlers for XIVE interrupt sources Cédric Le Goater
2017-11-28  5:45   ` David Gibson
2017-11-28 18:18     ` Cédric Le Goater
2017-12-02 14:26       ` Benjamin Herrenschmidt
2017-11-23 13:29 ` [Qemu-devel] [PATCH 10/25] spapr: add MMIO handlers for the " Cédric Le Goater
2017-11-28  6:38   ` David Gibson
2017-11-28 18:33     ` Cédric Le Goater
2017-11-29  4:59       ` David Gibson
2017-11-29 13:56         ` Cédric Le Goater
2017-11-29 16:23           ` Cédric Le Goater
2017-11-30  4:28             ` David Gibson
2017-11-30 16:05               ` Cédric Le Goater
2017-12-02 14:33               ` Benjamin Herrenschmidt
2017-12-02 14:28             ` Benjamin Herrenschmidt
2017-12-02 14:47               ` Cédric Le Goater
2017-11-30  4:26           ` David Gibson
2017-11-30 15:40             ` Cédric Le Goater
2017-12-02 14:23     ` Benjamin Herrenschmidt
2017-11-23 13:29 ` [Qemu-devel] [PATCH 11/25] spapr: describe the XIVE interrupt source flags Cédric Le Goater
2017-11-28  6:40   ` David Gibson
2017-11-28 18:23     ` Cédric Le Goater
2017-12-02 14:24     ` Benjamin Herrenschmidt
2017-12-02 14:38       ` Cédric Le Goater
2017-12-02 14:48         ` Benjamin Herrenschmidt
2017-12-02 14:50           ` Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 12/25] spapr: introduce a XIVE interrupt presenter model Cédric Le Goater
2017-11-29  5:11   ` David Gibson
2017-11-29  9:55     ` Cédric Le Goater
2017-11-30  4:06       ` David Gibson
2017-11-30 13:44         ` Cédric Le Goater
2017-12-01  4:03           ` David Gibson
2017-12-01  8:02             ` Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 13/25] spapr: introduce the XIVE Event Queues Cédric Le Goater
2017-11-23 20:31   ` Benjamin Herrenschmidt
2017-11-24  8:15     ` Cédric Le Goater
2017-11-26 21:52       ` Benjamin Herrenschmidt
2017-11-30  4:38   ` David Gibson
2017-11-30 14:06     ` Cédric Le Goater
2017-11-30 23:35       ` David Gibson
2017-12-01 16:36         ` Cédric Le Goater
2017-12-04  1:09           ` David Gibson
2017-12-04 16:31             ` Cédric Le Goater
2017-12-02 14:39     ` Benjamin Herrenschmidt
2017-12-02 14:41       ` Benjamin Herrenschmidt
2017-11-23 13:29 ` [Qemu-devel] [PATCH 14/25] spapr: push the XIVE EQ data in OS event queue Cédric Le Goater
2017-11-30  4:49   ` David Gibson
2017-11-30 14:16     ` Cédric Le Goater
2017-12-01  4:10       ` David Gibson
2017-12-01 16:43         ` Cédric Le Goater
2017-12-02 14:45         ` Benjamin Herrenschmidt
2017-12-02 14:46           ` Benjamin Herrenschmidt
2017-12-04  1:20             ` David Gibson
2017-12-05 10:58               ` Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 15/25] spapr: notify the CPU when the XIVE interrupt priority is more privileged Cédric Le Goater
2017-11-30  5:00   ` David Gibson
2017-11-30 16:17     ` Cédric Le Goater
2017-12-02 14:40     ` Benjamin Herrenschmidt
2017-12-04  1:17       ` David Gibson
2017-12-04 16:09         ` Benjamin Herrenschmidt
2017-12-07 11:55     ` Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 16/25] spapr: add support for the SET_OS_PENDING command (XIVE) Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 17/25] spapr: add a sPAPRXive object to the machine Cédric Le Goater
2017-11-30  5:55   ` David Gibson
2017-11-30 15:15     ` Cédric Le Goater
2017-12-01  4:14       ` David Gibson
2017-12-01  8:10         ` Cédric Le Goater
2017-12-04  1:59           ` David Gibson
2017-12-04  8:32             ` Cédric Le Goater
2017-12-04  8:40               ` David Gibson
2017-11-30 15:38     ` Cédric Le Goater
2017-12-01  4:17       ` David Gibson
2017-11-23 13:29 ` [Qemu-devel] [PATCH 18/25] spapr: allocate IRQ numbers for the XIVE interrupt mode Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 19/25] spapr: add hcalls support " Cédric Le Goater
2017-12-01  4:01   ` David Gibson
2017-12-01 17:46     ` Cédric Le Goater
2017-12-05  7:00       ` David Gibson
2017-12-05 14:50         ` Benjamin Herrenschmidt
2017-12-06  9:20           ` David Gibson
2017-12-06 19:41             ` Benjamin Herrenschmidt
2017-12-05 16:12         ` Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 20/25] spapr: add device tree " Cédric Le Goater
2017-12-04  7:49   ` David Gibson
2017-12-04 16:19     ` Cédric Le Goater
2017-12-05  3:38       ` David Gibson
2017-11-23 13:29 ` [Qemu-devel] [PATCH 21/25] spapr: introduce a helper to map the XIVE memory regions Cédric Le Goater
2017-12-04  7:52   ` David Gibson
2017-12-04 15:30     ` Cédric Le Goater
2017-12-05  2:24       ` David Gibson
2017-11-23 13:29 ` [Qemu-devel] [PATCH 22/25] spapr: add XIVE support to spapr_irq_get_qirq() Cédric Le Goater
2017-12-04  7:52   ` David Gibson
2017-11-23 13:29 ` [Qemu-devel] [PATCH 23/25] spapr: toggle the ICP depending on the selected interrupt mode Cédric Le Goater
2017-12-04  7:56   ` David Gibson
2017-11-23 13:29 ` [Qemu-devel] [PATCH 24/25] spapr: add support to dump XIVE information Cédric Le Goater
2017-11-23 13:29 ` [Qemu-devel] [PATCH 25/25] spapr: advertise XIVE exploitation mode in CAS Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).