* Bad error handling in machine sifive-u
@ 2021-12-06 12:53 Markus Armbruster
2021-12-07 12:16 ` Alistair Francis
0 siblings, 1 reply; 2+ messages in thread
From: Markus Armbruster @ 2021-12-06 12:53 UTC (permalink / raw)
To: Alistair Francis, Bin Meng, Palmer Dabbelt; +Cc: qemu-devel
Watch this:
$ ../qemu/bld/qemu-system-riscv64 -M sifive_u -S -monitor stdio -display none -drive if=pflash
QEMU 6.1.93 monitor - type 'help' for more information
(qemu) Unexpected error in sifive_u_otp_realize() at ../hw/misc/sifive_u_otp.c:229:
qemu-system-riscv64: OTP drive size < 16K
Aborted (core dumped)
sifive_u_machine_init() calls
qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
My reproducer demonstrates that passing &error_abort is wrong: this
realize can fail.
&error_fatal should do here.
Please check the other uses of &error_abort in this machine for similar
misuse.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Bad error handling in machine sifive-u
2021-12-06 12:53 Bad error handling in machine sifive-u Markus Armbruster
@ 2021-12-07 12:16 ` Alistair Francis
0 siblings, 0 replies; 2+ messages in thread
From: Alistair Francis @ 2021-12-07 12:16 UTC (permalink / raw)
To: Markus Armbruster
Cc: Palmer Dabbelt, Bin Meng, Alistair Francis,
qemu-devel@nongnu.org Developers
On Mon, Dec 6, 2021 at 11:15 PM Markus Armbruster <armbru@redhat.com> wrote:
>
> Watch this:
>
> $ ../qemu/bld/qemu-system-riscv64 -M sifive_u -S -monitor stdio -display none -drive if=pflash
> QEMU 6.1.93 monitor - type 'help' for more information
> (qemu) Unexpected error in sifive_u_otp_realize() at ../hw/misc/sifive_u_otp.c:229:
> qemu-system-riscv64: OTP drive size < 16K
> Aborted (core dumped)
>
> sifive_u_machine_init() calls
>
> qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
>
> My reproducer demonstrates that passing &error_abort is wrong: this
> realize can fail.
>
> &error_fatal should do here.
Thanks for pointing this out. I'll work on a patch to fix this up.
Alistair
>
> Please check the other uses of &error_abort in this machine for similar
> misuse.
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-07 12:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 12:53 Bad error handling in machine sifive-u Markus Armbruster
2021-12-07 12:16 ` Alistair Francis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.