[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v2 14/16] hw/cpu/arm11mpcore: Fix introspection proble
From: |
Thomas Huth |
Subject: |
[Qemu-arm] [PATCH v2 14/16] hw/cpu/arm11mpcore: Fix introspection problem with 'arm11mpcore_priv' |
Date: |
Fri, 13 Jul 2018 10:27:42 +0200 |
Valgrind reports an error here:
echo "{'execute':'qmp_capabilities'} {'execute':'device-list-properties'," \
"'arguments':{'typename':'arm11mpcore_priv'}}" \
"{'execute': 'human-monitor-command', " \
"'arguments': {'command-line': 'info qtree'}}" | \
valgrind -q aarch64-softmmu/qemu-system-aarch64 -M none,accel=qtest -qmp stdio
[...]
==3145== Invalid read of size 8
==3145== at 0x61873A: qdev_print (qdev-monitor.c:686)
==3145== by 0x61873A: qbus_print (qdev-monitor.c:719)
[...]
Use sysbus_init_child_obj() to fix it.
Signed-off-by: Thomas Huth <address@hidden>
---
hw/cpu/arm11mpcore.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c
index eb24465..8aead37 100644
--- a/hw/cpu/arm11mpcore.c
+++ b/hw/cpu/arm11mpcore.c
@@ -121,19 +121,17 @@ static void mpcore_priv_initfn(Object *obj)
"mpcore-priv-container", 0x2000);
sysbus_init_mmio(sbd, &s->container);
- object_initialize(&s->scu, sizeof(s->scu), TYPE_ARM11_SCU);
- qdev_set_parent_bus(DEVICE(&s->scu), sysbus_get_default());
+ sysbus_init_child_obj(obj, "scu", &s->scu, sizeof(s->scu), TYPE_ARM11_SCU);
- object_initialize(&s->gic, sizeof(s->gic), TYPE_ARM_GIC);
- qdev_set_parent_bus(DEVICE(&s->gic), sysbus_get_default());
+ sysbus_init_child_obj(obj, "gic", &s->gic, sizeof(s->gic), TYPE_ARM_GIC);
/* Request the legacy 11MPCore GIC behaviour: */
qdev_prop_set_uint32(DEVICE(&s->gic), "revision", 0);
- object_initialize(&s->mptimer, sizeof(s->mptimer), TYPE_ARM_MPTIMER);
- qdev_set_parent_bus(DEVICE(&s->mptimer), sysbus_get_default());
+ sysbus_init_child_obj(obj, "mptimer", &s->mptimer, sizeof(s->mptimer),
+ TYPE_ARM_MPTIMER);
- object_initialize(&s->wdtimer, sizeof(s->wdtimer), TYPE_ARM_MPTIMER);
- qdev_set_parent_bus(DEVICE(&s->wdtimer), sysbus_get_default());
+ sysbus_init_child_obj(obj, "wdtimer", &s->wdtimer, sizeof(s->wdtimer),
+ TYPE_ARM_MPTIMER);
}
static Property mpcore_priv_properties[] = {
--
1.8.3.1
- [Qemu-arm] [PATCH v2 07/16] hw/arm/xlnx-zynqmp: Fix crash when introspecting the "xlnx, zynqmp" device, (continued)
- [Qemu-arm] [PATCH v2 07/16] hw/arm/xlnx-zynqmp: Fix crash when introspecting the "xlnx, zynqmp" device, Thomas Huth, 2018/07/13
- [Qemu-arm] [PATCH v2 08/16] hw/arm/msf2-soc: Fix introspection problem with the "msf2-soc" device, Thomas Huth, 2018/07/13
- [Qemu-arm] [PATCH v2 09/16] hw/cpu/a9mpcore: Fix introspection problems with the "a9mpcore_priv" device, Thomas Huth, 2018/07/13
- [Qemu-arm] [PATCH v2 10/16] hw/arm/fsl-imx6: Fix introspection problems with the "fsl, imx6" device, Thomas Huth, 2018/07/13
- [Qemu-arm] [PATCH v2 11/16] hw/arm/fsl-imx7: Fix introspection problems with the "fsl, imx7" device, Thomas Huth, 2018/07/13
- [Qemu-arm] [PATCH v2 13/16] hw/arm/fsl-imx31: Fix introspection problem with the "fsl, imx31" device, Thomas Huth, 2018/07/13
- [Qemu-arm] [PATCH v2 12/16] hw/arm/fsl-imx25: Fix introspection problem with the "fsl, imx25" device, Thomas Huth, 2018/07/13
- [Qemu-arm] [PATCH v2 14/16] hw/cpu/arm11mpcore: Fix introspection problem with 'arm11mpcore_priv',
Thomas Huth <=
- [Qemu-arm] [PATCH v2 15/16] hw/*/realview: Fix introspection problem with 'realview_mpcore' & 'realview_gic', Thomas Huth, 2018/07/13
- [Qemu-arm] [PATCH v2 16/16] hw/arm/allwinner-a10: Fix introspection problem with 'allwinner-a10', Thomas Huth, 2018/07/13
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 00/16] Fix crashes with introspection of ARM devices, Richard Henderson, 2018/07/13
- Re: [Qemu-arm] [PATCH v2 00/16] Fix crashes with introspection of ARM devices, Eduardo Habkost, 2018/07/13