diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-10-18 08:16:31 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-10-20 14:46:07 +0200 |
commit | c85b843d177e48bb5367946ac6731073d32f831e (patch) | |
tree | 406155c882093fc38f3b8d9d9ded8512e76807f9 | |
parent | 74b253585de2def439cc400bc699b37de3e20727 (diff) | |
download | qemu-c85b843d177e48bb5367946ac6731073d32f831e.zip qemu-c85b843d177e48bb5367946ac6731073d32f831e.tar.gz qemu-c85b843d177e48bb5367946ac6731073d32f831e.tar.bz2 |
hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it
sysbus_mmio_map() should not be called on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20231018141151.87466-8-philmd@linaro.org>
-rw-r--r-- | hw/arm/virt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 02c7a7f..5b08a98 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -690,10 +690,10 @@ static void create_v2m(VirtMachineState *vms) DeviceState *dev; dev = qdev_new("arm-gicv2m"); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, vms->memmap[VIRT_GIC_V2M].base); qdev_prop_set_uint32(dev, "base-spi", irq); qdev_prop_set_uint32(dev, "num-spi", NUM_GICV2M_SPIS); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, vms->memmap[VIRT_GIC_V2M].base); for (i = 0; i < NUM_GICV2M_SPIS; i++) { sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, |