aboutsummaryrefslogtreecommitdiff
path: root/hw/loongarch
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-10-18 08:37:06 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2023-10-19 23:13:28 +0200
commitbec4be77ea18feb9d50a6c2ee42b6c3ffe4ae78b (patch)
tree66f87f88c5cf22ebea2f505f23741abecd6c6d66 /hw/loongarch
parent0493aafb1abbe6256522c32b5686418b5b192e7e (diff)
downloadqemu-bec4be77ea18feb9d50a6c2ee42b6c3ffe4ae78b.zip
qemu-bec4be77ea18feb9d50a6c2ee42b6c3ffe4ae78b.tar.gz
qemu-bec4be77ea18feb9d50a6c2ee42b6c3ffe4ae78b.tar.bz2
hw/acpi: Realize ACPI_GED 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> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20231018141151.87466-7-philmd@linaro.org>
Diffstat (limited to 'hw/loongarch')
-rw-r--r--hw/loongarch/virt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 2952fe4..4b7dc67 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -412,6 +412,7 @@ static DeviceState *create_acpi_ged(DeviceState *pch_pic, LoongArchMachineState
}
dev = qdev_new(TYPE_ACPI_GED);
qdev_prop_set_uint32(dev, "ged-event", event);
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
/* ged event */
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, VIRT_GED_EVT_ADDR);
@@ -422,7 +423,6 @@ static DeviceState *create_acpi_ged(DeviceState *pch_pic, LoongArchMachineState
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
qdev_get_gpio_in(pch_pic, VIRT_SCI_IRQ - VIRT_GSI_BASE));
- sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
return dev;
}