[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/40] spapr: introduce a spapr_irq_init() routine
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 21/40] spapr: introduce a spapr_irq_init() routine |
Date: |
Fri, 21 Dec 2018 16:45:47 +1100 |
From: Cédric Le Goater <address@hidden>
Initialize the MSI bitmap from it as this will be necessary for the
sPAPR IRQ backend for XIVE.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 2 +-
hw/ppc/spapr_irq.c | 16 +++++++++++-----
include/hw/ppc/spapr_irq.h | 1 +
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 2b2df6b848..c1c0e75fcd 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2593,7 +2593,7 @@ static void spapr_machine_init(MachineState *machine)
spapr_set_vsmt_mode(spapr, &error_fatal);
/* Set up Interrupt Controller before we create the VCPUs */
- smc->irq->init(spapr, &error_fatal);
+ spapr_irq_init(spapr, &error_fatal);
/* Set up containers for ibm,client-architecture-support negotiated options
*/
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index e77b94cc68..f8b651de0e 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -97,11 +97,6 @@ static void spapr_irq_init_xics(sPAPRMachineState *spapr,
Error **errp)
int nr_irqs = smc->irq->nr_irqs;
Error *local_err = NULL;
- /* Initialize the MSI IRQ allocator. */
- if (!SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
- spapr_irq_msi_init(spapr, smc->irq->nr_msis);
- }
-
if (kvm_enabled()) {
if (machine_kernel_irqchip_allowed(machine) &&
!xics_kvm_init(spapr, &local_err)) {
@@ -213,6 +208,17 @@ sPAPRIrq spapr_irq_xics = {
/*
* sPAPR IRQ frontend routines for devices
*/
+void spapr_irq_init(sPAPRMachineState *spapr, Error **errp)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
+
+ /* Initialize the MSI IRQ allocator. */
+ if (!SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
+ spapr_irq_msi_init(spapr, smc->irq->nr_msis);
+ }
+
+ smc->irq->init(spapr, errp);
+}
int spapr_irq_claim(sPAPRMachineState *spapr, int irq, bool lsi, Error **errp)
{
diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h
index a467ce696e..bd7301e6d9 100644
--- a/include/hw/ppc/spapr_irq.h
+++ b/include/hw/ppc/spapr_irq.h
@@ -43,6 +43,7 @@ typedef struct sPAPRIrq {
extern sPAPRIrq spapr_irq_xics;
extern sPAPRIrq spapr_irq_xics_legacy;
+void spapr_irq_init(sPAPRMachineState *spapr, Error **errp);
int spapr_irq_claim(sPAPRMachineState *spapr, int irq, bool lsi, Error **errp);
void spapr_irq_free(sPAPRMachineState *spapr, int irq, int num);
qemu_irq spapr_qirq(sPAPRMachineState *spapr, int irq);
--
2.19.2
- [Qemu-devel] [PULL 22/40] spapr: export and rename the xics_max_server_number() routine, (continued)
- [Qemu-devel] [PULL 22/40] spapr: export and rename the xics_max_server_number() routine, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 14/40] e500: simplify IRQ wiring, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 09/40] ppc405_uc: use g_new(T, n) instead of g_malloc(sizeof(T) * n), David Gibson, 2018/12/21
- [Qemu-devel] [PULL 23/40] Changes requirement for "vsubsbs" instruction, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 17/40] ppc/xive: introduce the XiveNotifier interface, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 06/40] target/ppc: use g_new(T, n) instead of g_malloc(sizeof(T) * n), David Gibson, 2018/12/21
- [Qemu-devel] [PULL 18/40] ppc/xive: introduce the XiveRouter model, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 16/40] ppc/xive: add support for the LSI interrupt sources, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 24/40] ppc/xive: add support for the END Event State Buffers, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 19/40] ppc/xive: introduce the XIVE Event Notification Descriptors, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 21/40] spapr: introduce a spapr_irq_init() routine,
David Gibson <=
- [Qemu-devel] [PULL 34/40] spapr: allocate the interrupt thread context under the CPU core, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 26/40] ppc/xive: introduce a simplified XIVE presenter, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 25/40] ppc/xive: introduce the XIVE interrupt thread context, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 29/40] spapr/xive: use the VCPU id as a NVT identifier, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 27/40] ppc/xive: notify the CPU when the interrupt priority is more privileged, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 28/40] spapr/xive: introduce a XIVE interrupt controller, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 32/40] spapr: add hcalls support for the XIVE exploitation interrupt mode, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 30/40] spapr-iommu: Always advertise the maximum possible DMA window size, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 33/40] spapr: add device tree support for the XIVE exploitation mode, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 31/40] spapr: introduce a new machine IRQ backend for XIVE, David Gibson, 2018/12/21