[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [RFC PATCH v2 20/21] ppc/xics: introduce a qirq_get() helper
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [RFC PATCH v2 20/21] ppc/xics: introduce a qirq_get() helper in the XICSFabric |
Date: |
Mon, 11 Sep 2017 19:12:34 +0200 |
It will be used to choose the appropriate set of qirqs when XIVE is
activated.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xics.c | 7 +------
hw/ppc/spapr.c | 12 ++++++++++++
include/hw/ppc/xics.h | 1 +
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 927d4fec966a..7691492aa17b 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -685,13 +685,8 @@ static const TypeInfo xics_fabric_info = {
qemu_irq xics_get_qirq(XICSFabric *xi, int irq)
{
XICSFabricClass *xic = XICS_FABRIC_GET_CLASS(xi);
- ICSState *ics = xic->ics_get(xi, irq);
- if (ics) {
- return ics->qirqs[irq - ics->offset];
- }
-
- return NULL;
+ return xic->qirq_get(xi, irq);
}
ICPState *xics_icp_get(XICSFabric *xi, int server)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index c2011cb2dc72..d8b25be70cd8 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3455,6 +3455,17 @@ static void spapr_phb_placement(sPAPRMachineState
*spapr, uint32_t index,
*mmio64 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM64_WIN_SIZE;
}
+static qemu_irq spapr_qirq_get(XICSFabric *dev, int irq)
+{
+ sPAPRMachineState *spapr = SPAPR_MACHINE(dev);
+
+ if (!ics_valid_irq(spapr->ics, irq)) {
+ return NULL;
+ }
+
+ return spapr->ics->qirqs[irq - spapr->ics->offset];
+}
+
static ICSState *spapr_ics_get(XICSFabric *dev, int irq)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(dev);
@@ -3539,6 +3550,7 @@ static void spapr_machine_class_init(ObjectClass *oc,
void *data)
vhc->unmap_hptes = spapr_unmap_hptes;
vhc->store_hpte = spapr_store_hpte;
vhc->get_patbe = spapr_get_patbe;
+ xic->qirq_get = spapr_qirq_get;
xic->ics_get = spapr_ics_get;
xic->ics_resend = spapr_ics_resend;
xic->icp_get = spapr_icp_get;
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index c835997303c4..46d2fc1ef2c1 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -178,6 +178,7 @@ struct XICSFabric {
typedef struct XICSFabricClass {
InterfaceClass parent;
+ qemu_irq (*qirq_get)(XICSFabric *xi, int irq);
ICSState *(*ics_get)(XICSFabric *xi, int irq);
void (*ics_resend)(XICSFabric *xi);
ICPState *(*icp_get)(XICSFabric *xi, int server);
--
2.13.5
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, (continued)
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Cédric Le Goater, 2017/09/20
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, David Gibson, 2017/09/20
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Cédric Le Goater, 2017/09/21
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, David Gibson, 2017/09/22
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Benjamin Herrenschmidt, 2017/09/28
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Cédric Le Goater, 2017/09/28
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Benjamin Herrenschmidt, 2017/09/28
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Cédric Le Goater, 2017/09/28
- Re: [Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Benjamin Herrenschmidt, 2017/09/28
[Qemu-ppc] [RFC PATCH v2 19/21] ppc/xive: introduce a helper to map the XIVE memory regions, Cédric Le Goater, 2017/09/11
[Qemu-ppc] [RFC PATCH v2 20/21] ppc/xics: introduce a qirq_get() helper in the XICSFabric,
Cédric Le Goater <=
[Qemu-ppc] [RFC PATCH v2 21/21] spapr: activate XIVE exploitation mode, Cédric Le Goater, 2017/09/11
Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), David Gibson, 2017/09/19
- Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), David Gibson, 2017/09/19
- Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), Cédric Le Goater, 2017/09/20
- Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), David Gibson, 2017/09/20
- Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), Cédric Le Goater, 2017/09/21
- Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), David Gibson, 2017/09/22
- Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), Cédric Le Goater, 2017/09/22
Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), Benjamin Herrenschmidt, 2017/09/28
Re: [Qemu-ppc] [RFC PATCH v2 00/21] Guest exploitation of the XIVE interrupt controller (POWER9), David Gibson, 2017/09/28