[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 34/37] sysbus: add a sysbus_mmio_unmap() helper
From: |
Cédric Le Goater |
Subject: |
[Qemu-devel] [PATCH v6 34/37] sysbus: add a sysbus_mmio_unmap() helper |
Date: |
Thu, 6 Dec 2018 00:22:48 +0100 |
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>
Reviewed-by: David Gibson <address@hidden>
---
include/hw/sysbus.h | 1 +
hw/core/sysbus.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index 0b59a3b8d605..bc641984b5da 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);
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 7ac36ad3e707..09f202167dcb 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -153,6 +153,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);
--
2.17.2
- [Qemu-devel] [PATCH v6 25/37] spapr/xive: add state synchronization with KVM, (continued)
- [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, 2018/12/05
- [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 <=
- [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