[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 30/37] spapr/xive: enable XIVE MMIOs at reset
From: |
Cédric Le Goater |
Subject: |
[Qemu-devel] [PATCH v6 30/37] spapr/xive: enable XIVE MMIOs at reset |
Date: |
Thu, 6 Dec 2018 00:22:44 +0100 |
Depending on the interrupt mode chosen, enable or disable the XIVE
MMIOs.
Signed-off-by: Cédric Le Goater <address@hidden>
---
include/hw/ppc/spapr_xive.h | 1 +
hw/intc/spapr_xive.c | 9 +++++++++
hw/ppc/spapr_irq.c | 8 ++++++++
3 files changed, 18 insertions(+)
diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h
index 277771eeb4d5..735e916d3844 100644
--- a/include/hw/ppc/spapr_xive.h
+++ b/include/hw/ppc/spapr_xive.h
@@ -65,6 +65,7 @@ void spapr_dt_xive(sPAPRMachineState *spapr, uint32_t
nr_servers, void *fdt,
uint32_t phandle);
void spapr_xive_reset_tctx(sPAPRXive *xive);
void spapr_xive_map_mmio(sPAPRXive *xive);
+void spapr_xive_enable_mmio(sPAPRXive *xive, bool enable);
/*
* KVM XIVE device helpers
diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
index b030cfe7f136..68d2a6fd8177 100644
--- a/hw/intc/spapr_xive.c
+++ b/hw/intc/spapr_xive.c
@@ -196,6 +196,15 @@ void spapr_xive_map_mmio(sPAPRXive *xive)
sysbus_mmio_map(SYS_BUS_DEVICE(xive), 2, xive->tm_base);
}
+void spapr_xive_enable_mmio(sPAPRXive *xive, bool enable)
+{
+ memory_region_set_enabled(&xive->source.esb_mmio, enable);
+ memory_region_set_enabled(&xive->tm_mmio, enable);
+
+ /* Disable the END ESBs until a guest OS makes use of them */
+ memory_region_set_enabled(&xive->end_source.esb_mmio, false);
+}
+
/*
* When a Virtual Processor is scheduled to run on a HW thread, the
* hypervisor pushes its identifier in the OS CAM line. Emulate the
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index f9b5564b271c..94bb4d27758a 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -216,6 +216,11 @@ static void spapr_irq_reset_xics(sPAPRMachineState *spapr,
Error **errp)
CPU_FOREACH(cs) {
spapr_cpu_core_set_intc(POWERPC_CPU(cs), spapr->icp_type);
}
+
+ /* Deactivate the XIVE MMIOs */
+ if (spapr->xive) {
+ spapr_xive_enable_mmio(spapr->xive, false);
+ }
}
#define SPAPR_IRQ_XICS_NR_IRQS 0x1000
@@ -365,6 +370,9 @@ static void spapr_irq_reset_xive(sPAPRMachineState *spapr,
Error **errp)
* to come after the XiveTCTX reset handlers.
*/
spapr_xive_reset_tctx(spapr->xive);
+
+ /* Activate the XIVE MMIOs */
+ spapr_xive_enable_mmio(spapr->xive, true);
}
/*
--
2.17.2
- [Qemu-devel] [PATCH v6 19/37] spapr: allocate the interrupt thread context under the CPU core, (continued)
- [Qemu-devel] [PATCH v6 19/37] spapr: allocate the interrupt thread context under the CPU core, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 20/37] spapr: extend the sPAPR IRQ backend for XICS migration, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 17/37] spapr: add hcalls support for the XIVE exploitation interrupt mode, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 21/37] spapr: add a 'reset' method to the sPAPR IRQ backend, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 22/37] spapr: add a 'pseries-3.1-xive' machine type, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 23/37] linux-headers: update to 4.20-rc5, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 25/37] spapr/xive: add state synchronization with KVM, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 26/37] spapr/xive: introduce a VM state change handler, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 28/37] spapr/xive: fix migration of the XiveTCTX under TCG, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 29/37] spapr: set the interrupt presenter at reset, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 30/37] spapr/xive: enable XIVE MMIOs at reset,
Cédric Le Goater <=
- [Qemu-devel] [PATCH v6 27/37] spapr/xive: add migration support for KVM, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 24/37] spapr/xive: add KVM support, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 31/37] spapr: add a 'pseries-3.1-dual' machine type, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 32/37] ppc/xics: introduce a icp_kvm_connect() routine, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 33/37] spapr/rtas: modify spapr_rtas_register() to remove RTAS handlers, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 34/37] sysbus: add a sysbus_mmio_unmap() helper, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 35/37] spapr: introduce routines to delete the KVM IRQ device, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 36/37] spapr: check for KVM IRQ device activation, Cédric Le Goater, 2018/12/05
- [Qemu-devel] [PATCH v6 37/37] spapr: add KVM support to the 'dual' machine, Cédric Le Goater, 2018/12/05
- Re: [Qemu-devel] [PATCH v6 00/37] ppc: support for the XIVE interrupt controller (POWER9), no-reply, 2018/12/05