[PATCH v2] target/riscv: remove warnings about Smdbltrp/Smrnmi being disabled

Clément Léger posted 1 patch 12 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250213145640.117275-1-cleger@rivosinc.com
Maintainers: Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
target/riscv/tcg/tcg-cpu.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
[PATCH v2] target/riscv: remove warnings about Smdbltrp/Smrnmi being disabled
Posted by Clément Léger 12 months ago
As raised by Richard Henderson, these warnings are displayed in user
only as well. Since they aren't really useful for the end-user, remove
them and add a "TODO" note in the leading comments.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
---

v2:
 - Remove Tommy bouncing mail from the recipient list
 - Entirely remove warnings and add "TODO" in the leading comments

 target/riscv/tcg/tcg-cpu.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
index 0a137281de..94bfafd7db 100644
--- a/target/riscv/tcg/tcg-cpu.c
+++ b/target/riscv/tcg/tcg-cpu.c
@@ -1432,22 +1432,20 @@ static void riscv_init_max_cpu_extensions(Object *obj)
     }
 
     /*
-     * ext_smrnmi requires OpenSBI changes that our current
+     * TODO: ext_smrnmi requires OpenSBI changes that our current
      * image does not have. Disable it for now.
      */
     if (cpu->cfg.ext_smrnmi) {
         isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smrnmi), false);
-        qemu_log("Smrnmi is disabled in the 'max' type CPU\n");
     }
 
     /*
-     * ext_smdbltrp requires the firmware to clear MSTATUS.MDT on startup to
-     * avoid generating a double trap. OpenSBI does not currently support it,
+     * TODO: ext_smdbltrp requires the firmware to clear MSTATUS.MDT on startup
+     * to avoid generating a double trap. OpenSBI does not currently support it,
      * disable it for now.
      */
     if (cpu->cfg.ext_smdbltrp) {
         isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smdbltrp), false);
-        qemu_log("Smdbltrp is disabled in the 'max' type CPU\n");
     }
 }
 
-- 
2.47.2


Re: [PATCH v2] target/riscv: remove warnings about Smdbltrp/Smrnmi being disabled
Posted by Alistair Francis 11 months, 3 weeks ago
On Fri, Feb 14, 2025 at 12:57 AM Clément Léger <cleger@rivosinc.com> wrote:
>
> As raised by Richard Henderson, these warnings are displayed in user
> only as well. Since they aren't really useful for the end-user, remove
> them and add a "TODO" note in the leading comments.
>
> Signed-off-by: Clément Léger <cleger@rivosinc.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
>
> v2:
>  - Remove Tommy bouncing mail from the recipient list
>  - Entirely remove warnings and add "TODO" in the leading comments
>
>  target/riscv/tcg/tcg-cpu.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
> index 0a137281de..94bfafd7db 100644
> --- a/target/riscv/tcg/tcg-cpu.c
> +++ b/target/riscv/tcg/tcg-cpu.c
> @@ -1432,22 +1432,20 @@ static void riscv_init_max_cpu_extensions(Object *obj)
>      }
>
>      /*
> -     * ext_smrnmi requires OpenSBI changes that our current
> +     * TODO: ext_smrnmi requires OpenSBI changes that our current
>       * image does not have. Disable it for now.
>       */
>      if (cpu->cfg.ext_smrnmi) {
>          isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smrnmi), false);
> -        qemu_log("Smrnmi is disabled in the 'max' type CPU\n");
>      }
>
>      /*
> -     * ext_smdbltrp requires the firmware to clear MSTATUS.MDT on startup to
> -     * avoid generating a double trap. OpenSBI does not currently support it,
> +     * TODO: ext_smdbltrp requires the firmware to clear MSTATUS.MDT on startup
> +     * to avoid generating a double trap. OpenSBI does not currently support it,
>       * disable it for now.
>       */
>      if (cpu->cfg.ext_smdbltrp) {
>          isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smdbltrp), false);
> -        qemu_log("Smdbltrp is disabled in the 'max' type CPU\n");
>      }
>  }
>
> --
> 2.47.2
>
>
Re: [PATCH v2] target/riscv: remove warnings about Smdbltrp/Smrnmi being disabled
Posted by Daniel Henrique Barboza 12 months ago

On 2/13/25 11:56 AM, Clément Léger wrote:
> As raised by Richard Henderson, these warnings are displayed in user
> only as well. Since they aren't really useful for the end-user, remove
> them and add a "TODO" note in the leading comments.
> 
> Signed-off-by: Clément Léger <cleger@rivosinc.com>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

> 
> v2:
>   - Remove Tommy bouncing mail from the recipient list
>   - Entirely remove warnings and add "TODO" in the leading comments
> 
>   target/riscv/tcg/tcg-cpu.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
> index 0a137281de..94bfafd7db 100644
> --- a/target/riscv/tcg/tcg-cpu.c
> +++ b/target/riscv/tcg/tcg-cpu.c
> @@ -1432,22 +1432,20 @@ static void riscv_init_max_cpu_extensions(Object *obj)
>       }
>   
>       /*
> -     * ext_smrnmi requires OpenSBI changes that our current
> +     * TODO: ext_smrnmi requires OpenSBI changes that our current
>        * image does not have. Disable it for now.
>        */
>       if (cpu->cfg.ext_smrnmi) {
>           isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smrnmi), false);
> -        qemu_log("Smrnmi is disabled in the 'max' type CPU\n");
>       }
>   
>       /*
> -     * ext_smdbltrp requires the firmware to clear MSTATUS.MDT on startup to
> -     * avoid generating a double trap. OpenSBI does not currently support it,
> +     * TODO: ext_smdbltrp requires the firmware to clear MSTATUS.MDT on startup
> +     * to avoid generating a double trap. OpenSBI does not currently support it,
>        * disable it for now.
>        */
>       if (cpu->cfg.ext_smdbltrp) {
>           isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_smdbltrp), false);
> -        qemu_log("Smdbltrp is disabled in the 'max' type CPU\n");
>       }
>   }
>