[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 12/17] hw/cpu/arm11mpcore: Fix introspection
From: |
Alistair Francis |
Subject: |
Re: [Qemu-devel] [PATCH v3 12/17] hw/cpu/arm11mpcore: Fix introspection problem with 'arm11mpcore_priv' |
Date: |
Mon, 16 Jul 2018 15:06:37 -0700 |
On Mon, Jul 16, 2018 at 5:59 AM, Thomas Huth <address@hidden> wrote:
> 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.
>
> Reviewed-by: Richard Henderson <address@hidden>
> Reviewed-by: Paolo Bonzini <address@hidden>
> Reviewed-by: Eduardo Habkost <address@hidden>
> Signed-off-by: Thomas Huth <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Alistair
> ---
> 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-devel] [PATCH v3 05/17] hw/cpu/a15mpcore: Fix introspection problem with the a15mpcore_priv device, (continued)
- [Qemu-devel] [PATCH v3 05/17] hw/cpu/a15mpcore: Fix introspection problem with the a15mpcore_priv device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 06/17] hw/arm/msf2-soc: Fix introspection problem with the "msf2-soc" device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 07/17] hw/cpu/a9mpcore: Fix introspection problems with the "a9mpcore_priv" device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 08/17] hw/arm/fsl-imx6: Fix introspection problems with the "fsl, imx6" device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 09/17] hw/arm/fsl-imx7: Fix introspection problems with the "fsl, imx7" device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 11/17] hw/arm/fsl-imx31: Fix introspection problem with the "fsl, imx31" device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 10/17] hw/arm/fsl-imx25: Fix introspection problem with the "fsl, imx25" device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 12/17] hw/cpu/arm11mpcore: Fix introspection problem with 'arm11mpcore_priv', Thomas Huth, 2018/07/16
- Re: [Qemu-devel] [PATCH v3 12/17] hw/cpu/arm11mpcore: Fix introspection problem with 'arm11mpcore_priv',
Alistair Francis <=
- [Qemu-devel] [PATCH v3 14/17] hw/arm/allwinner-a10: Fix introspection problem with 'allwinner-a10', Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 13/17] hw/*/realview: Fix introspection problem with 'realview_mpcore' & 'realview_gic', Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 15/17] hw/arm/stm32f205_soc: Fix introspection problem with 'stm32f205-soc' device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 17/17] hw/arm/xlnx-zynqmp: Fix crash when introspecting the "xlnx, zynqmp" device, Thomas Huth, 2018/07/16
- [Qemu-devel] [PATCH v3 16/17] hw/display/xlnx_dp: Move problematic code from instance_init to realize, Thomas Huth, 2018/07/16