Skip to content

Commit

Permalink
hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
philmd committed Oct 20, 2023
1 parent 74b2535 commit c85b843
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/arm/virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c85b843

Please sign in to comment.