spapr/irq: add an 'nr_irq' parameter to initialize the backend.
commit2e66cdb715b2df674a9dd1b2899b958a46a98bdc
authorCédric Le Goater <clg@kaod.org>
Wed, 13 Feb 2019 21:07:55 +0000 (13 22:07 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sun, 17 Feb 2019 10:54:02 +0000 (17 21:54 +1100)
tree6f9c4c695725dec2edfed0165c9f829d385db755
parentcc941111a5bc5f498185fa3824c3b6579c7d45ad
spapr/irq: add an 'nr_irq' parameter to initialize the backend.

When using the 'dual' interrupt mode, the source numbers of both sPAPR
IRQ backends are aligned to share a common IRQ number space and to use
a similar mapping of the machine qemu_irq array which is indexed by
the source number.

The XICS IRQ number range initially being [ 0x1000 - 0x2000 ], this
requires to change the XICS ICSState offset to 0 and to provision for
an extra 4K of source numbers and qemu_irqs which will never be used
by the machine when running under the XICS interrupt mode. This is not
an optimal solution.

Change the init() method to allocate an IRQ number space of the
expected size for the XICS sPAPR IRQ backend. It breaks the interrupt
signaling when under the 'dual' mode because source numbers have
unexpected values but next patch will fix that.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190213210756.27032-2-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_irq.c
include/hw/ppc/spapr_irq.h