diff mbox series

[v2,1/2] hw/riscv: Make CPU config error handling generous (virt/spike)

Message ID d17381d3ea4992808cf1894f379ca67220f61b45.1652509778.git.research_trasio@irq.a4lg.com (mailing list archive)
State New, archived
Headers show
Series hw/riscv: Make CPU config error handling generous | expand

Commit Message

Tsukasa OI May 14, 2022, 6:29 a.m. UTC
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>
---
 hw/riscv/spike.c | 2 +-
 hw/riscv/virt.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Alistair Francis May 17, 2022, 12:36 a.m. UTC | #1
On Sat, May 14, 2022 at 4:29 PM Tsukasa OI <research_trasio@irq.a4lg.com> wrote:
>
> 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>

Alistair

> ---
>  hw/riscv/spike.c | 2 +-
>  hw/riscv/virt.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
> index 068ba3493e..e41b6aa9f0 100644
> --- a/hw/riscv/spike.c
> +++ b/hw/riscv/spike.c
> @@ -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(
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index 3326f4db96..244d6408b5 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -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) {
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index 068ba3493e..e41b6aa9f0 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -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(
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 3326f4db96..244d6408b5 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -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) {