Skip to content

spapr: generic IRQ frontend

Cédric Le Goater qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 27 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4spapr: remove irq_hint parameter from spapr_irq_alloc()hw/ppc/spapr.c hw/ppc/spapr_events.c hw/ppc/spapr_vio.c +1 more+11 -2216 replies
2/4sparp_pci: simplify how the PCI LSIs are allocatedhw/ppc/spapr_pci.c+10 -115 replies
3/4spapr: introduce a generic IRQ frontend to the machinehw/ppc/Makefile.objs hw/ppc/spapr.c hw/ppc/spapr_events.c +5 more+308 -1933 replies
4/4spapr: introduce a new IRQ backend using fixed IRQ number rangeshw/ppc/spapr.c hw/ppc/spapr_irq.c include/hw/ppc/spapr.h +1 more+255 -13 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchGreg Kurz
1/4
2/4R-b
3/4R-b
4/4

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/4] spapr: generic IRQ frontend

Hello,

This proposal moves all the related IRQ routines of the sPAPR machine behind a class interface to prepare for future changes in the IRQ controller model. First of which is a reorganization of the IRQ number space layout and a second, coming later, will be to integrate the support for the new POWER9 XIVE IRQ controller.

The new interface defines a set of fixed IRQ number ranges, for each IRQ type, in which devices allocate the IRQ numbers they need depending on a unique device index. Here is the layout :

RANGES DEVICES

   0x0000 - 0x0FFF    Reserved for future use (IPI = 2)
   0x1000 - 0x1000    1 EPOW
   0x1001 - 0x1001    1 HOTPLUG
   0x1002 - 0x10FF    unused
   0x1100 - 0x11FF    256 VIO devices    (1 IRQ each)
   0x1200 - 0x1283    32 PCI LSI devices (4 IRQs each)
   0x1284 - 0x13FF    unused
   0x1400 - 0x17FF    PCI MSI device 1   (1024 IRQs each)
   0x1800 - 0x1BFF    PCI MSI device 1
   0x1c00 - 0x1FFF    PCI MSI device 2

0x2000 .... not allocated. Need to increase NR_IRQS

Each device model is modified to take the new interface into account using the IRQ range/type definitions and a device index. A part from the VIO devices, lacking an id, the changes are relatively simple.

The MSI range is a bit more complex to handle as the IRQS are dynamically allocated by the guest OS. In consequence, we use a bitmap allocator under the machine for these.

The XICS IRQ number space is increased to 4K, which gives three MSI ranges of 1K for the PHBs. The XICS source IRQ numbers still have the 4K offset.

Thanks,

C.

Cédric Le Goater (4):
spapr: remove irq_hint parameter from spapr_irq_alloc()
sparp_pci: simplify how the PCI LSIs are allocated
spapr: introduce a generic IRQ frontend to the machine
spapr: introduce a new IRQ backend using fixed IRQ number ranges

 include/hw/ppc/spapr.h     |  13 +-
 include/hw/ppc/spapr_irq.h |  58 ++++++
 hw/ppc/spapr.c             | 208 +++------------------
 hw/ppc/spapr_events.c      |   8 +-
 hw/ppc/spapr_irq.c         | 451 +++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/spapr_pci.c         |  40 ++--
 hw/ppc/spapr_vio.c         |   5 +-
 hw/ppc/Makefile.objs       |   2 +-
 8 files changed, 571 insertions(+), 214 deletions(-)
 create mode 100644 include/hw/ppc/spapr_irq.h
 create mode 100644 hw/ppc/spapr_irq.c
Signature · 1 line
2.13.6