target/riscv: silent warnings about Smdbltrp/Smrnmi being disabled
PATCH 1/1 target/riscv: silent warnings about Smdbltrp/Smrnmi being disabled
As raised by Richard Henderson, these warnings are displayed in user only as well. Disable them for CONFIG_USER_ONLY.
--- target/riscv/tcg/tcg-cpu.c | 4 ++++ 1 file changed, 4 insertions(+)
target/riscv/tcg/tcg-cpu.c +4 -0
@@ -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 } }
Signature · 1 line
2.47.2
Quoted 5 lines · Clément Léger
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 <[email protected]>---
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
Quoted 27 lines
target/riscv/tcg/tcg-cpu.c | 4 ++++ 1 file changed, 4 insertions(+)target/riscv/tcg/tcg-cpu.c +4
-0@@ -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 } }
Quoted 11 lines · Daniel Henrique Barboza
Quoted 5 lines · Clément Léger
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 <[email protected]>---
I'm second guessing having these warnings at all.
Quoted 7 lines
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_ONLYgates 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
Quoted 37 lines
Thanks,
Daniel
Quoted 29 lines
target/riscv/tcg/tcg-cpu.c| 4 ++++1 file changed, 4 insertions(+)target/riscv/tcg/tcg-cpu.c +4
-0@@ -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 }}
Quoted 11 lines · Daniel Henrique Barboza
Quoted 5 lines · Clément Léger
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 <[email protected]>---
I'm second guessing having these warnings at all.
Quoted 7 lines
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_ONLYgates 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.
Quoted 8 lines
Thanks,
Daniel
Quoted 3 lines
target/riscv/tcg/tcg-cpu.c| 4 ++++1 file changed, 4 insertions(+)