aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/microvm.c
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/i386/microvm.c
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/i386/microvm.c')
-rw-r--r--hw/i386/microvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index b9c9303..ca55aec 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -206,12 +206,12 @@ static void microvm_devices_init(MicrovmMachineState *mms)
if (x86_machine_is_acpi_enabled(x86ms)) {
DeviceState *dev = qdev_new(TYPE_ACPI_GED);
qdev_prop_set_uint32(dev, "ged-event", ACPI_GED_PWR_DOWN_EVT);
+ sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, GED_MMIO_BASE);
/* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 2, GED_MMIO_BASE_REGS);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
x86ms->gsi[GED_MMIO_IRQ]);
- sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
x86ms->acpi_dev = HOTPLUG_HANDLER(dev);
}