[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/12] hw/sysbus: Ensure device is not realized before adding MMI
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 11/12] hw/sysbus: Ensure device is not realized before adding MMIO region |
Date: |
Wed, 18 Oct 2023 16:11:49 +0200 |
sysbus_init_mmio() should not be called on realized device.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/core/sysbus.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 35f902b582..ce54e2c416 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -192,6 +192,11 @@ void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion
*memory)
int n;
assert(dev->num_mmio < QDEV_MAX_MMIO);
+ if (DEVICE(dev)->realized) {
+ error_report("sysbus_init_mmio(type:%s) but object is realized",
+ object_get_typename(OBJECT(dev)));
+ abort();
+ }
n = dev->num_mmio++;
dev->mmio[n].addr = -1;
dev->mmio[n].memory = memory;
--
2.41.0
- [PATCH 07/12] hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it, (continued)
- [PATCH 07/12] hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it, Philippe Mathieu-Daudé, 2023/10/18
- [PATCH 08/12] hw/isa: Realize ISA BUS sysbus device before accessing it, Philippe Mathieu-Daudé, 2023/10/18
- [PATCH 09/12] hw/s390x/css-bridge: Realize sysbus device before accessing it, Philippe Mathieu-Daudé, 2023/10/18
- [PATCH 10/12] hw/qdev: Ensure parent device is not realized before adding bus, Philippe Mathieu-Daudé, 2023/10/18
- [PATCH 11/12] hw/sysbus: Ensure device is not realized before adding MMIO region,
Philippe Mathieu-Daudé <=
- [PATCH 12/12] hw/sysbus: Ensure device is realized before mapping it, Philippe Mathieu-Daudé, 2023/10/18
- Re: [PATCH 00/12] hw: Strengthen SysBus & QBus API, Michael S. Tsirkin, 2023/10/18
- Re: [PATCH 00/12] hw: Strengthen SysBus & QBus API, Thomas Huth, 2023/10/18