[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v3 15/35] sysbus: add a sysbus_mmio_unmap() helper
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH v3 15/35] sysbus: add a sysbus_mmio_unmap() helper |
Date: |
Thu, 19 Apr 2018 14:43:11 +0200 |
This will be used to remove the MMIO regions of the POWER9 XIVE
interrupt controller when the sPAPR machine is reseted.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/core/sysbus.c | 10 ++++++++++
include/hw/sysbus.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 5d0887f499de..e31f8e6be2f1 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -152,6 +152,16 @@ static void sysbus_mmio_map_common(SysBusDevice *dev, int
n, hwaddr addr,
}
}
+void sysbus_mmio_unmap(SysBusDevice *dev, int n)
+{
+ assert(n >= 0 && n < dev->num_mmio);
+
+ if (dev->mmio[n].addr != (hwaddr)-1) {
+ memory_region_del_subregion(get_system_memory(), dev->mmio[n].memory);
+ dev->mmio[n].addr = (hwaddr)-1;
+ }
+}
+
void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr addr)
{
sysbus_mmio_map_common(dev, n, addr, false, 0);
diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index e88bb6dae0c1..2446983de167 100644
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -92,6 +92,7 @@ qemu_irq sysbus_get_connected_irq(SysBusDevice *dev, int n);
void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr addr);
void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr,
int priority);
+void sysbus_mmio_unmap(SysBusDevice *dev, int n);
void sysbus_add_io(SysBusDevice *dev, hwaddr addr,
MemoryRegion *mem);
MemoryRegion *sysbus_address_space(SysBusDevice *dev);
--
2.13.6
- [Qemu-ppc] [PATCH v3 07/35] spapr/xive: introduce the XIVE Event Queues, (continued)
- [Qemu-ppc] [PATCH v3 07/35] spapr/xive: introduce the XIVE Event Queues, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 08/35] spapr: push the XIVE EQ data in OS event queue, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 09/35] spapr: notify the CPU when the XIVE interrupt priority is more privileged, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 10/35] spapr: add support for the SET_OS_PENDING command (XIVE), Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 11/35] spapr: introduce a 'xive_exploitation' option to enable XIVE, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 12/35] spapr: add a sPAPRXive object to the machine, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 14/35] spapr: add device tree support for the XIVE exploitation mode, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 13/35] spapr: add hcalls support for the XIVE exploitation interrupt mode, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 15/35] sysbus: add a sysbus_mmio_unmap() helper,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH v3 16/35] spapr: introduce a helper to map the XIVE memory regions, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 17/35] spapr: add XIVE support to spapr_qirq(), Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 18/35] spapr: introduce a spapr_icp_create() helper, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 19/35] spapr: toggle the ICP depending on the selected interrupt mode, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 20/35] spapr: add support to dump XIVE information, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 21/35] spapr: advertise XIVE exploitation mode in CAS, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 22/35] spapr: add classes for the XIVE models, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 23/35] target/ppc/kvm: add Linux KVM definitions for XIVE, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 24/35] spapr/xive: add common realize routine for KVM, Cédric Le Goater, 2018/04/19
- [Qemu-ppc] [PATCH v3 25/35] spapr/xive: add KVM support, Cédric Le Goater, 2018/04/19