qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.12 v2 00/12] spapr: introduce an IRQ allocator at the machine level
@ 2017-11-09 10:14 Cédric Le Goater
  2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 01/12] spapr: add pseries 2.12 machine type Cédric Le Goater
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Cédric Le Goater @ 2017-11-09 10:14 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel, David Gibson, Greg Kurz,
	Benjamin Herrenschmidt
  Cc: Cédric Le Goater

Hello,

Currently, the ICSState 'ics' object of the sPAPR machine acts as the
global interrupt source handler and also as the IRQ number allocator
for the machine. Some IRQ numbers are allocated very early in the
machine initialization sequence to populate the device tree, and this
is a problem to introduce the new POWER XIVE interrupt model, as it
needs to share the IRQ numbers with the older model.

To prepare ground for XIVE, here is a proposal adding a set of new
XICSFabric operations to let the machine handle directly the IRQ
number allocation and to decorrelate the allocation from the interrupt
source object :

    bool (*irq_test)(XICSFabric *xi, int irq);
    int (*irq_alloc_block)(XICSFabric *xi, int count, int align);
    void (*irq_free_block)(XICSFabric *xi, int irq, int num);
    bool (*irq_is_lsi)(XICSFabric *xi, int irq);

In these prototypes, the 'irq' parameter refers to a number in the
global IRQ number space.

On the sPAPR platform, these operations are simply backed by a bitmap
and to handle migration compatibility, we introduce a machine class
flag 'has_irq_bitmap', which is set to false for older machines.


To completely remove the use of the ICSState object (required to
introduce XIVE), we also need to change how the nature of an
interrupt, MSI or LSI, is stored. Today, this is done using the flag
attribute of the ICSIRQState array. We change that by splitting the
IRQ number space of the machine in two: first the LSIs and then the
MSIs. This has the benefit to keep the LSI IRQ numbers in a well known
range which is useful for PHB hotplug.

The git repo for this pachset can be found here along with the latest
XIVE model:

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

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)

Changes since v1 :

 - reorganised patchset to introduce the XICSFabric operations before
   the major changes: bitmap and IRQ number space split   
 - introduced a reference bitmap to save some state in migration

Cédric Le Goater (12):
  spapr: add pseries 2.12 machine type
  ppc/xics: remove useless if condition
  spapr: introduce new XICSFabric operations for an IRQ allocator
  spapr: move current IRQ allocation under the machine
  spapr: introduce an IRQ allocator using a bitmap
  spapr: store a reference IRQ bitmap
  spapr: introduce an 'irq_base' number
  spapr: remove the use of ics_valid_irq()
  spapr: introduce a XICSFabric is_lsi() operation
  spapr: split the IRQ number space for LSI interrupts
  sparp: merge ics_set_irq_type() in irq_alloc_block() operation
  spapr: use sPAPRMachineState in spapr_ics_ prototypes

 hw/intc/trace-events   |   2 -
 hw/intc/xics.c         |  37 ++++++-----
 hw/intc/xics_kvm.c     |   4 +-
 hw/intc/xics_spapr.c   |  76 ++++-----------------
 hw/ppc/pnv.c           |  34 ++++++++++
 hw/ppc/pnv_psi.c       |   4 --
 hw/ppc/spapr.c         | 174 ++++++++++++++++++++++++++++++++++++++++++++++++-
 hw/ppc/spapr_events.c  |   4 +-
 hw/ppc/spapr_pci.c     |   8 +--
 hw/ppc/spapr_vio.c     |   2 +-
 hw/ppc/trace-events    |   2 +
 include/hw/ppc/spapr.h |   6 ++
 include/hw/ppc/xics.h  |  20 ++++--
 13 files changed, 267 insertions(+), 106 deletions(-)

-- 
2.13.6

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

end of thread, other threads:[~2017-11-09 19:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-09 10:14 [Qemu-devel] [PATCH for-2.12 v2 00/12] spapr: introduce an IRQ allocator at the machine level Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 01/12] spapr: add pseries 2.12 machine type Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 02/12] ppc/xics: remove useless if condition Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 03/12] spapr: introduce new XICSFabric operations for an IRQ allocator Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 04/12] spapr: move current IRQ allocation under the machine Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 05/12] spapr: introduce an IRQ allocator using a bitmap Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 06/12] spapr: store a reference IRQ bitmap Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 07/12] spapr: introduce an 'irq_base' number Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 08/12] spapr: remove the use of ics_valid_irq() Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 09/12] spapr: introduce a XICSFabric irq_is_lsi() operation Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 10/12] spapr: split the IRQ number space for LSI interrupts Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 11/12] sparp: merge ics_set_irq_type() in irq_alloc_block() operation Cédric Le Goater
2017-11-09 10:14 ` [Qemu-devel] [PATCH for-2.12 v2 12/12] spapr: use sPAPRMachineState in spapr_ics_ prototypes Cédric Le Goater
2017-11-09 18:33 ` [Qemu-devel] [Qemu-ppc] [PATCH for-2.12 v2 00/12] spapr: introduce an IRQ allocator at the machine level 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).