* [PATCH] target/riscv: silent warnings about Smdbltrp/Smrnmi being disabled
@ 2025-02-13 7:52 Clément Léger
2025-02-13 11:32 ` Daniel Henrique Barboza
0 siblings, 1 reply; 4+ messages in thread
From: Clément Léger @ 2025-02-13 7:52 UTC (permalink / raw)
To: qemu-riscv, Palmer Dabbelt, Alistair Francis, Bin Meng, Tommy Wu
Cc: Clément Léger, Daniel Henrique Barboza,
Richard Henderson, qemu-devel
As raised by Richard Henderson, these warnings are displayed in user
only as well. Disable them for CONFIG_USER_ONLY.
Signed-off-by: Clément Léger <cleger@rivosinc.com>
---
target/riscv/tcg/tcg-cpu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
index 0a137281de..4d0d16576d 100644
--- a/target/riscv/tcg/tcg-cpu.c
+++ b/target/riscv/tcg/tcg-cpu.c
@@ -1437,7 +1437,9 @@ static void riscv_init_max_cpu_extensions(Object *obj)
*/
if (cpu->cfg.ext_smrnmi) {
isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smrnmi), false);
+#ifndef CONFIG_USER_ONLY
qemu_log("Smrnmi is disabled in the 'max' type CPU\n");
+#endif
}
/*
@@ -1447,7 +1449,9 @@ static void riscv_init_max_cpu_extensions(Object *obj)
*/
if (cpu->cfg.ext_smdbltrp) {
isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smdbltrp), false);
+#ifndef CONFIG_USER_ONLY
qemu_log("Smdbltrp is disabled in the 'max' type CPU\n");
+#endif
}
}
--
2.47.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] target/riscv: silent warnings about Smdbltrp/Smrnmi being disabled
2025-02-13 7:52 [PATCH] target/riscv: silent warnings about Smdbltrp/Smrnmi being disabled Clément Léger
@ 2025-02-13 11:32 ` Daniel Henrique Barboza
2025-02-13 13:25 ` Clément Léger
2025-02-13 14:46 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 4+ messages in thread
From: Daniel Henrique Barboza @ 2025-02-13 11:32 UTC (permalink / raw)
To: Clément Léger, qemu-riscv, Palmer Dabbelt,
Alistair Francis, Bin Meng, Tommy Wu
Cc: Richard Henderson, qemu-devel
On 2/13/25 4:52 AM, Clément Léger wrote:
> As raised by Richard Henderson, these warnings are displayed in user
> only as well. Disable them for CONFIG_USER_ONLY.
>
> Signed-off-by: Clément Léger <cleger@rivosinc.com>
> ---
I'm second guessing having these warnings at all.
Sure they serve as a warning for us, developers, that something needs to
be revisited (e.g. after an OpenSBI update). However it will degrade user
experience with warnings related to something out of the user control.
Instead of adding CONFIG_USER_ONLY gates for these warnings I believe we're
better of removing them. We can add TODO/FIXME tags in the code if there's
something that we need to revisit at a later time.
Thanks,
Daniel
> target/riscv/tcg/tcg-cpu.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
> index 0a137281de..4d0d16576d 100644
> --- a/target/riscv/tcg/tcg-cpu.c
> +++ b/target/riscv/tcg/tcg-cpu.c
> @@ -1437,7 +1437,9 @@ static void riscv_init_max_cpu_extensions(Object *obj)
> */
> if (cpu->cfg.ext_smrnmi) {
> isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smrnmi), false);
> +#ifndef CONFIG_USER_ONLY
> qemu_log("Smrnmi is disabled in the 'max' type CPU\n");
> +#endif
> }
>
> /*
> @@ -1447,7 +1449,9 @@ static void riscv_init_max_cpu_extensions(Object *obj)
> */
> if (cpu->cfg.ext_smdbltrp) {
> isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smdbltrp), false);
> +#ifndef CONFIG_USER_ONLY
> qemu_log("Smdbltrp is disabled in the 'max' type CPU\n");
> +#endif
> }
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/riscv: silent warnings about Smdbltrp/Smrnmi being disabled
2025-02-13 11:32 ` Daniel Henrique Barboza
@ 2025-02-13 13:25 ` Clément Léger
2025-02-13 14:46 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 4+ messages in thread
From: Clément Léger @ 2025-02-13 13:25 UTC (permalink / raw)
To: Daniel Henrique Barboza, qemu-riscv, Palmer Dabbelt,
Alistair Francis, Bin Meng, Tommy Wu
Cc: Richard Henderson, qemu-devel
On 13/02/2025 12:32, Daniel Henrique Barboza wrote:
>
>
> On 2/13/25 4:52 AM, Clément Léger wrote:
>> As raised by Richard Henderson, these warnings are displayed in user
>> only as well. Disable them for CONFIG_USER_ONLY.
>>
>> Signed-off-by: Clément Léger <cleger@rivosinc.com>
>> ---
>
> I'm second guessing having these warnings at all.
>
> Sure they serve as a warning for us, developers, that something needs to
> be revisited (e.g. after an OpenSBI update). However it will degrade user
> experience with warnings related to something out of the user control.
>
> Instead of adding CONFIG_USER_ONLY gates for these warnings I believe we're
> better of removing them. We can add TODO/FIXME tags in the code if there's
> something that we need to revisit at a later time.
Hi Daniel,
Agreed, I'll add some TODO comment and remove these warnings then.
Thanks,
Clément
>
>
> Thanks,
>
> Daniel
>
>
>> target/riscv/tcg/tcg-cpu.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
>> index 0a137281de..4d0d16576d 100644
>> --- a/target/riscv/tcg/tcg-cpu.c
>> +++ b/target/riscv/tcg/tcg-cpu.c
>> @@ -1437,7 +1437,9 @@ static void riscv_init_max_cpu_extensions(Object
>> *obj)
>> */
>> if (cpu->cfg.ext_smrnmi) {
>> isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smrnmi), false);
>> +#ifndef CONFIG_USER_ONLY
>> qemu_log("Smrnmi is disabled in the 'max' type CPU\n");
>> +#endif
>> }
>> /*
>> @@ -1447,7 +1449,9 @@ static void riscv_init_max_cpu_extensions(Object
>> *obj)
>> */
>> if (cpu->cfg.ext_smdbltrp) {
>> isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smdbltrp),
>> false);
>> +#ifndef CONFIG_USER_ONLY
>> qemu_log("Smdbltrp is disabled in the 'max' type CPU\n");
>> +#endif
>> }
>> }
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/riscv: silent warnings about Smdbltrp/Smrnmi being disabled
2025-02-13 11:32 ` Daniel Henrique Barboza
2025-02-13 13:25 ` Clément Léger
@ 2025-02-13 14:46 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-02-13 14:46 UTC (permalink / raw)
To: Daniel Henrique Barboza, Clément Léger, qemu-riscv,
Palmer Dabbelt, Alistair Francis, Bin Meng, Tommy Wu
Cc: Richard Henderson, qemu-devel
On 13/2/25 12:32, Daniel Henrique Barboza wrote:
>
>
> On 2/13/25 4:52 AM, Clément Léger wrote:
>> As raised by Richard Henderson, these warnings are displayed in user
>> only as well. Disable them for CONFIG_USER_ONLY.
>>
>> Signed-off-by: Clément Léger <cleger@rivosinc.com>
>> ---
>
> I'm second guessing having these warnings at all.
>
> Sure they serve as a warning for us, developers, that something needs to
> be revisited (e.g. after an OpenSBI update). However it will degrade user
> experience with warnings related to something out of the user control.
>
> Instead of adding CONFIG_USER_ONLY gates for these warnings I believe we're
> better of removing them. We can add TODO/FIXME tags in the code if there's
> something that we need to revisit at a later time.
You can also convert them to trace events, which are less invasive,
or warn_report(). But IIUC this case I agree a comment is good enough.
> Thanks,
>
> Daniel
>
>
>> target/riscv/tcg/tcg-cpu.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-13 14:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-13 7:52 [PATCH] target/riscv: silent warnings about Smdbltrp/Smrnmi being disabled Clément Léger
2025-02-13 11:32 ` Daniel Henrique Barboza
2025-02-13 13:25 ` Clément Léger
2025-02-13 14:46 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).