qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Cédric Le Goater
Subject: [Qemu-devel] [PATCH 0/4] spapr: generic IRQ frontend
Date: Fri, 18 May 2018 18:44:01 +0200

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

-- 
2.13.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]