Skip to content

spapr: introduce an IRQ allocator at the machine level

Cédric Le Goater qemu-devel 3 versions – Applied

Status from this message: Applied to ppc-for-2.12.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest11 patches 67 repliesApplied
  2. v212 patches 1 replySuperseded
  3. v18 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- introduced a second set of XICSFabric IRQ operations for older pseries machines

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/11spapr: add pseries 2.12 machine typehw/ppc/spapr.c+15 -138 replies
2/11ppc/xics: remove useless if conditionhw/intc/xics_spapr.c+2 -42 replies
3/11spapr: introduce new XICSFabric operations for an IRQ allocatorhw/ppc/spapr.c include/hw/ppc/xics.h+23 -05 replies
4/11spapr: move current IRQ allocation under the machinehw/intc/trace-events hw/intc/xics.c hw/intc/xics_spapr.c +3 more+85 -531 reply
5/11spapr: introduce an IRQ allocator using a bitmaphw/ppc/spapr.c include/hw/ppc/spapr.h+74 -59 replies
6/11spapr: store a reference IRQ bitmaphw/ppc/spapr.c include/hw/ppc/spapr.h+7 -11 reply
7/11spapr: introduce an 'irq_base' numberhw/ppc/spapr.c include/hw/ppc/spapr.h+5 -33 replies
8/11spapr: introduce a XICSFabric irq_is_lsi() operationhw/intc/xics.c hw/intc/xics_kvm.c hw/ppc/pnv.c +2 more+46 -115 replies
9/11spapr: split the IRQ number space for LSI interruptshw/intc/xics_spapr.c hw/ppc/spapr.c include/hw/ppc/xics.h+33 -83 replies
10/11sparp: merge ics_set_irq_type() in irq_alloc_block() operationhw/intc/xics.c hw/intc/xics_spapr.c hw/ppc/pnv_psi.c +2 more+14 -190 replies
11/11spapr: use sPAPRMachineState in spapr_ics_ prototypeshw/intc/xics_spapr.c hw/ppc/spapr.c hw/ppc/spapr_events.c +3 more+29 -330 replies

Reviews trailers per patch

5 of 11 patches have a Reviewed-by or Acked-by.

PatchGreg Kurz
1/11R-b
2/11R-b
3/11R-b
4/11R-b
5/11
6/11
7/11
8/11R-b
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Qemu-devel] [PATCH for-2.12 v3 00/11] spapr: introduce an IRQ allocator at the machine level

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 latest pseries machines, these operations are simply backed by a bitmap and to handle migration compatibility, we keep an old set of operations using the ICSIRQState array.

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 v2 :

- introduced a second set of XICSFabric IRQ operations for older pseries machines

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 (11):
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: introduce a XICSFabric irq_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         | 209 ++++++++++++++++++++++++++++++++++++++++++++++++-
 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 |   5 ++
 include/hw/ppc/xics.h  |  20 +++--
 13 files changed, 301 insertions(+), 106 deletions(-)
Signature · 1 line
2.13.6