riscv-pull queue
Subsystems (2)
The following changes since commit ea6abffa8a08d832feb759d359d5b935e3087cf7:
Update version for v3.0.0-rc1 release (2018-07-17 18:15:19 +0100)
are available in the Git repository at:
[email protected]:alistair23/qemu.git tags/pull-riscv-pull-20180718-2
for you to fetch changes up to 451ea962be0cbb6710737eeb90c2a801b979cad3:
spike: Fix crash when introspecting the device (2018-07-18 14:33:40 -0700)
----------------------------------------------------------------
riscv: Fix introspection problems
This is based on Thomas's work fixing introspection problems [1] and applied to the RISC-V port.
1: https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg03261.html
----------------------------------------------------------------
Alistair Francis (5):
sifive_e: Fix crash when introspecting the device
sifive_u: Fix crash when introspecting the device
virt: Fix crash when introspecting the device
riscv_hart: Fix crash when introspecting the device
spike: Fix crash when introspecting the device
hw/riscv/riscv_hart.c | 7 +++---- hw/riscv/sifive_e.c | 12 ++++++------ hw/riscv/sifive_u.c | 15 +++++++-------- hw/riscv/spike.c | 10 ++++------ hw/riscv/virt.c | 5 ++--- 5 files changed, 22 insertions(+), 27 deletions(-)
[Qemu-devel] [PULL 1/5] sifive_e: Fix crash when introspecting the device
Use the new object_initialize_child() and sysbus_init_child_obj() to fix the issue.
--- hw/riscv/sifive_e.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
hw/riscv/sifive_e.c +6 -6
@@ -105,9 +105,9 @@ static void riscv_sifive_e_init(MachineState *machine)int i;/* Initialize SoC */ -object_initialize (&s->soc,sizeof (s->soc),TYPE_RISCV_E_SOC ); -object_property_add_child (OBJECT (machine),"soc" ,OBJECT (&s->soc), - &error_abort); +object_initialize_child (OBJECT (machine),"soc" , &s->soc, +sizeof (s->soc),TYPE_RISCV_E_SOC , + &error_abort,NULL );object_property_set_bool (OBJECT (&s->soc), true,"realized" , &error_abort);
@@ -139,9 +139,9 @@ static void riscv_sifive_e_soc_init(Object *obj) {SiFiveESoCState *s =RISCV_E_SOC (obj); -object_initialize (&s->cpus,sizeof (s->cpus),TYPE_RISCV_HART_ARRAY ); -object_property_add_child (obj,"cpus" ,OBJECT (&s->cpus), - &error_abort); +object_initialize_child (obj,"cpus" , &s->cpus, +sizeof (s->cpus),TYPE_RISCV_HART_ARRAY , + &error_abort,NULL );object_property_set_str (OBJECT (&s->cpus),SIFIVE_E_CPU ,"cpu-type" , &error_abort); object_property_set_int(OBJECT(&s->cpus), smp_cpus, "num-harts",
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 3/5] virt: Fix crash when introspecting the device
In reply to Alistair FrancisUse the new object_initialize_child() and sysbus_init_child_obj() to fix the issue.
--- hw/riscv/virt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
hw/riscv/virt.c +2 -3
@@ -274,9 +274,8 @@ static void riscv_virt_board_init(MachineState *machine)void *fdt;/* Initialize SOC */ -object_initialize (&s->soc,sizeof (s->soc),TYPE_RISCV_HART_ARRAY ); -object_property_add_child (OBJECT (machine),"soc" ,OBJECT (&s->soc), - &error_abort); +object_initialize_child (OBJECT (machine),"soc" , &s->soc,sizeof (s->soc), +TYPE_RISCV_HART_ARRAY , &error_abort,NULL );object_property_set_str (OBJECT (&s->soc),VIRT_CPU ,"cpu-type" , &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts",
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 2/5] sifive_u: Fix crash when introspecting the device
In reply to Alistair FrancisUse the new object_initialize_child() and sysbus_init_child_obj() to fix the issue.
--- hw/riscv/sifive_u.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
hw/riscv/sifive_u.c +7 -8
@@ -244,9 +244,9 @@ static void riscv_sifive_u_init(MachineState *machine)int i;/* Initialize SoC */ -object_initialize (&s->soc,sizeof (s->soc),TYPE_RISCV_U_SOC ); -object_property_add_child (OBJECT (machine),"soc" ,OBJECT (&s->soc), - &error_abort); +object_initialize_child (OBJECT (machine),"soc" , &s->soc, +sizeof (s->soc),TYPE_RISCV_U_SOC , + &error_abort,NULL );object_property_set_bool (OBJECT (&s->soc), true,"realized" , &error_abort);
@@ -303,16 +303,15 @@ static void riscv_sifive_u_soc_init(Object *obj) {SiFiveUSoCState *s =RISCV_U_SOC (obj); -object_initialize (&s->cpus,sizeof (s->cpus),TYPE_RISCV_HART_ARRAY ); -object_property_add_child (obj,"cpus" ,OBJECT (&s->cpus), - &error_abort); +object_initialize_child (obj,"cpus" , &s->cpus,sizeof (s->cpus), +TYPE_RISCV_HART_ARRAY , &error_abort,NULL );object_property_set_str (OBJECT (&s->cpus),SIFIVE_U_CPU ,"cpu-type" , &error_abort);object_property_set_int (OBJECT (&s->cpus), smp_cpus,"num-harts" , &error_abort); -object_initialize (&s->gem,sizeof (s->gem),TYPE_CADENCE_GEM ); -qdev_set_parent_bus (DEVICE (&s->gem),sysbus_get_default ()); +sysbus_init_child_obj (obj,"gem" , &s->gem,sizeof (s->gem), +TYPE_CADENCE_GEM ); }static void riscv_sifive_u_soc_realize (DeviceState *dev,Error **errp)
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 4/5] riscv_hart: Fix crash when introspecting the device
In reply to Alistair FrancisUse the new object_initialize_child() and sysbus_init_child_obj() to fix the issue.
--- hw/riscv/riscv_hart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
hw/riscv/riscv_hart.c +3 -4
@@ -45,11 +45,10 @@ static void riscv_harts_realize(DeviceState *dev, Error **errp) s->harts =g_new0 (RISCVCPU , s->num_harts);for (n =0 ; n < s->num_harts; n++) { - -object_initialize (&s->harts[n],sizeof (RISCVCPU ), s->cpu_type); +object_initialize_child (OBJECT (s),"harts[*]" , &s->harts[n], +sizeof (RISCVCPU ), s->cpu_type, + &error_abort,NULL ); s->harts[n].env.mhartid = n; -object_property_add_child (OBJECT (s),"harts[*]" ,OBJECT (&s->harts[n]), - &error_abort);qemu_register_reset (riscv_harts_cpu_reset, &s->harts[n]);object_property_set_bool (OBJECT (&s->harts[n]), true,"realized" , &err);
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 5/5] spike: Fix crash when introspecting the device
In reply to Alistair FrancisUse the new object_initialize_child() and sysbus_init_child_obj() to fix the issue.
--- hw/riscv/spike.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
hw/riscv/spike.c +4 -6
@@ -171,9 +171,8 @@ static void spike_v1_10_0_board_init(MachineState *machine)int i;/* Initialize SOC */ -object_initialize (&s->soc,sizeof (s->soc),TYPE_RISCV_HART_ARRAY ); -object_property_add_child (OBJECT (machine),"soc" ,OBJECT (&s->soc), - &error_abort); +object_initialize_child (OBJECT (machine),"soc" , &s->soc,sizeof (s->soc), +TYPE_RISCV_HART_ARRAY , &error_abort,NULL );object_property_set_str (OBJECT (&s->soc),SPIKE_V1_10_0_CPU ,"cpu-type" , &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts",
@@ -254,9 +253,8 @@ static void spike_v1_09_1_board_init(MachineState *machine)int i;/* Initialize SOC */ -object_initialize (&s->soc,sizeof (s->soc),TYPE_RISCV_HART_ARRAY ); -object_property_add_child (OBJECT (machine),"soc" ,OBJECT (&s->soc), - &error_abort); +object_initialize_child (OBJECT (machine),"soc" , &s->soc,sizeof (s->soc), +TYPE_RISCV_HART_ARRAY , &error_abort,NULL );object_property_set_str (OBJECT (&s->soc),SPIKE_V1_09_1_CPU ,"cpu-type" , &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts",
Signature · 1 line
2.17.1
Quoted 20 lines · Alistair Francis
The following changes since commit
ea6abffa8a08d832feb759d359d5b935e3087cf7:Update version for v3.0.0-rc1 release (2018-07-17 18:15:19 +0100)
are available in the Git repository at:
[email protected]:alistair23/qemu.git tags/pull-riscv-pull-20180718-2
for you to fetch changes up to
451ea962be0cbb6710737eeb90c2a801b979cad3:spike: Fix crash when introspecting the device (2018-07-18 14:33:40 -0700)
----------------------------------------------------------------
riscv: Fix introspection problemsThis is based on Thomas's work fixing introspection problems [1] and applied to the RISC-V port.
1: https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg03261.html
Quoted 7 lines
----------------------------------------------------------------
Alistair Francis (5):
sifive_e: Fix crash when introspecting the device
sifive_u: Fix crash when introspecting the device
virt: Fix crash when introspecting the device
riscv_hart: Fix crash when introspecting the device
spike: Fix crash when introspecting the device
Argh! I just realised I left off Michael's review. I'll have to send a v2.
I'll tag it as v3.0 as well.
Alistair
Quoted 7 lines
hw/riscv/riscv_hart.c | 7 +++---- hw/riscv/sifive_e.c | 12 ++++++------ hw/riscv/sifive_u.c | 15 +++++++-------- hw/riscv/spike.c | 10 ++++------ hw/riscv/virt.c | 5 ++--- 5 files changed, 22 insertions(+), 27 deletions(-)