[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 17/35] spapr: add XIVE support to spapr_qirq()
From: |
Cédric Le Goater |
Subject: |
[Qemu-devel] [PATCH v3 17/35] spapr: add XIVE support to spapr_qirq() |
Date: |
Thu, 19 Apr 2018 14:43:13 +0200 |
The XIVE object has its own set of qirqs which is to be used when the
XIVE exploitation interrupt mode is activated.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/spapr_xive.c | 13 +++++++++++++
hw/ppc/spapr.c | 4 ++++
include/hw/ppc/spapr_xive.h | 1 +
include/hw/ppc/xive.h | 6 ++++++
4 files changed, 24 insertions(+)
diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
index 7aba6e571a93..98e067bfc90c 100644
--- a/hw/intc/spapr_xive.c
+++ b/hw/intc/spapr_xive.c
@@ -263,3 +263,16 @@ void spapr_xive_mmio_unmap(sPAPRXive *xive)
sysbus_mmio_unmap(SYS_BUS_DEVICE(xive), 0);
sysbus_mmio_unmap(SYS_BUS_DEVICE(xive), 1);
}
+
+qemu_irq spapr_xive_qirq(sPAPRXive *xive, int lisn)
+{
+ XiveIVE *ive = spapr_xive_get_ive(XIVE_FABRIC(xive), lisn);
+ XiveSource *xsrc = &xive->source;
+
+ if (!ive || !(ive->w & IVE_VALID)) {
+ qemu_log_mask(LOG_GUEST_ERROR, "XIVE: invalid LISN %d\n", lisn);
+ return NULL;
+ }
+
+ return xive_source_qirq(xsrc, lisn - xsrc->offset);
+}
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a9770f8f0a6e..4fcc942ccfa3 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3941,6 +3941,10 @@ qemu_irq spapr_qirq(sPAPRMachineState *spapr, int irq)
{
ICSState *ics = spapr->ics;
+ if (spapr_ovec_test(spapr->ov5_cas, OV5_XIVE_EXPLOIT)) {
+ return spapr_xive_qirq(spapr->xive, irq);
+ }
+
if (ics_valid_irq(ics, irq)) {
return ics->qirqs[irq - ics->offset];
}
diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h
index 0373b1c995bc..df87e68b3d05 100644
--- a/include/hw/ppc/spapr_xive.h
+++ b/include/hw/ppc/spapr_xive.h
@@ -37,6 +37,7 @@ bool spapr_xive_irq_disable(sPAPRXive *xive, uint32_t lisn);
void spapr_xive_pic_print_info(sPAPRXive *xive, Monitor *mon);
void spapr_xive_mmio_map(sPAPRXive *xive);
void spapr_xive_mmio_unmap(sPAPRXive *xive);
+qemu_irq spapr_xive_qirq(sPAPRXive *xive, int lisn);
/*
* sPAPR encoding of EQ indexes
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index 6cc02638c677..328b093eb9c3 100644
--- a/include/hw/ppc/xive.h
+++ b/include/hw/ppc/xive.h
@@ -155,6 +155,12 @@ static inline void xive_source_irq_set(XiveSource *xsrc,
uint32_t srcno,
xsrc->status[srcno] |= lsi ? XIVE_STATUS_LSI : 0;
}
+static inline qemu_irq xive_source_qirq(XiveSource *xsrc, uint32_t srcno)
+{
+ assert(srcno < xsrc->nr_irqs);
+ return xsrc->qirqs[srcno];
+}
+
/*
* XIVE Interrupt Presenter
*/
--
2.13.6
- [Qemu-devel] [PATCH v3 07/35] spapr/xive: introduce the XIVE Event Queues, (continued)
- [Qemu-devel] [PATCH v3 07/35] spapr/xive: introduce the XIVE Event Queues, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 08/35] spapr: push the XIVE EQ data in OS event queue, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 09/35] spapr: notify the CPU when the XIVE interrupt priority is more privileged, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 10/35] spapr: add support for the SET_OS_PENDING command (XIVE), Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 11/35] spapr: introduce a 'xive_exploitation' option to enable XIVE, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 12/35] spapr: add a sPAPRXive object to the machine, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 13/35] spapr: add hcalls support for the XIVE exploitation interrupt mode, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 14/35] spapr: add device tree support for the XIVE exploitation mode, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 15/35] sysbus: add a sysbus_mmio_unmap() helper, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 16/35] spapr: introduce a helper to map the XIVE memory regions, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 17/35] spapr: add XIVE support to spapr_qirq(),
Cédric Le Goater <=
- [Qemu-devel] [PATCH v3 18/35] spapr: introduce a spapr_icp_create() helper, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 19/35] spapr: toggle the ICP depending on the selected interrupt mode, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 20/35] spapr: add support to dump XIVE information, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 21/35] spapr: advertise XIVE exploitation mode in CAS, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 22/35] spapr: add classes for the XIVE models, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 23/35] target/ppc/kvm: add Linux KVM definitions for XIVE, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 24/35] spapr/xive: add common realize routine for KVM, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 25/35] spapr/xive: add KVM support, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 26/35] spapr/xive: add a XIVE KVM device to the machine, Cédric Le Goater, 2018/04/19
- [Qemu-devel] [PATCH v3 27/35] migration: discard non-migratable RAMBlocks, Cédric Le Goater, 2018/04/19