Skip to content

Commit

Permalink
hw/riscv: Make CPU config error handling generous (virt/spike)
Browse files Browse the repository at this point in the history
If specified CPU configuration is not valid, not just it prints error
message, it aborts and generates core dumps (depends on the operating
system).  This kind of error handling should be used only when a serious
runtime error occurs.

This commit makes error handling on CPU configuration more generous on
virt/spike machines.  It now just prints error message and quits (without
coredumps and aborts).

Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <d17381d3ea4992808cf1894f379ca67220f61b45.1652509778.git.research_trasio@irq.a4lg.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
a4lg authored and alistair23 committed May 24, 2022
1 parent a4a9a44 commit 4bcfc39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hw/riscv/spike.c
Expand Up @@ -230,7 +230,7 @@ static void spike_board_init(MachineState *machine)
base_hartid, &error_abort);
object_property_set_int(OBJECT(&s->soc[i]), "num-harts",
hart_count, &error_abort);
sysbus_realize(SYS_BUS_DEVICE(&s->soc[i]), &error_abort);
sysbus_realize(SYS_BUS_DEVICE(&s->soc[i]), &error_fatal);

/* Core Local Interruptor (timer and IPI) for each socket */
riscv_aclint_swi_create(
Expand Down
2 changes: 1 addition & 1 deletion hw/riscv/virt.c
Expand Up @@ -1351,7 +1351,7 @@ static void virt_machine_init(MachineState *machine)
base_hartid, &error_abort);
object_property_set_int(OBJECT(&s->soc[i]), "num-harts",
hart_count, &error_abort);
sysbus_realize(SYS_BUS_DEVICE(&s->soc[i]), &error_abort);
sysbus_realize(SYS_BUS_DEVICE(&s->soc[i]), &error_fatal);

if (!kvm_enabled()) {
if (s->have_aclint) {
Expand Down

0 comments on commit 4bcfc39

Please sign in to comment.