[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/38] sysbus: add a sysbus_mmio_unmap() helper
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 32/38] sysbus: add a sysbus_mmio_unmap() helper |
Date: |
Tue, 21 May 2019 16:29:18 +1000 |
From: Cédric Le Goater <address@hidden>
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>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <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 307cf90a51..689a867a22 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);
diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index 1aedcf05c9..4c668fbbdc 100644
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -89,6 +89,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.21.0
- [Qemu-devel] [PULL 17/38] target/ppc: Optimise VSX_LOAD_SCALAR_DS and VSX_VECTOR_LOAD_STORE, (continued)
- [Qemu-devel] [PULL 17/38] target/ppc: Optimise VSX_LOAD_SCALAR_DS and VSX_VECTOR_LOAD_STORE, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 08/38] target/ppc: Fix xvxsigdp, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 29/38] spapr/xive: introduce a VM state change handler, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 27/38] spapr/xive: add hcall support when under KVM, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 24/38] spapr: Print out extra hints when CAS negotiation of interrupt mode fails, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 16/38] Fix typo on "info pic" monitor cmd output for xive, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 22/38] target/ppc: Use vector variable shifts for VSL, VSR, VSRA, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 21/38] spapr: Add forgotten capability to migration stream, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 30/38] spapr/xive: add migration support for KVM, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 31/38] spapr/xive: activate KVM support, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 32/38] sysbus: add a sysbus_mmio_unmap() helper,
David Gibson <=
- [Qemu-devel] [PULL 25/38] linux-headers: Update linux headers to 5.2-rc1, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 28/38] spapr/xive: add state synchronization with KVM, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 26/38] spapr/xive: add KVM support, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 23/38] spapr: Fix phb_placement backwards compatibility, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 33/38] spapr: introduce routines to delete the KVM IRQ device, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 36/38] spapr/irq: initialize the IRQ device only once, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 37/38] ppc/xics: fix irq priority in ics_set_irq_type(), David Gibson, 2019/05/21
- [Qemu-devel] [PULL 38/38] spapr/irq: add KVM support to the 'dual' machine, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 34/38] spapr: check for the activation of the KVM IRQ device, David Gibson, 2019/05/21
- [Qemu-devel] [PULL 35/38] spapr/irq: introduce a spapr_irq_init_device() helper, David Gibson, 2019/05/21