From 826923fa607b136ce917d7c705579e4d8c42194e Mon Sep 17 00:00:00 2001 From: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Date: Tue, 10 Sep 2024 12:55:04 +0300 Subject: [PATCH 1/2] Revert "target/riscv: re-apply patch do stop avoid warnings when a non-existent CSR is hidden" This reverts commit e56dc61697e91cf7273476ec3126078692a5e387. The reverted commit claims to be the same as b201a5db23c0db34c0e10fd1c7c08fc73a5ec3fc, but it's not -- it changes the warning in `riscv_reg_impl_expose_csrs()` instead of the one in `riscv_reg_impl_hide_csrs()`. --- src/target/riscv/riscv_reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/riscv/riscv_reg.c b/src/target/riscv/riscv_reg.c index ec21c46af..eefd4029a 100644 --- a/src/target/riscv/riscv_reg.c +++ b/src/target/riscv/riscv_reg.c @@ -730,7 +730,7 @@ int riscv_reg_impl_expose_csrs(const struct target *target) struct reg * const reg = riscv_reg_impl_cache_entry(target, regno); const unsigned int csr_number = regno - GDB_REGNO_CSR0; if (reg->exist) { - LOG_TARGET_DEBUG(target, + LOG_TARGET_WARNING(target, "Not exposing CSR %d: register already exists.", csr_number); continue; From 7a70a28e6b6f3c4e1bbef8d16fe824c046adb289 Mon Sep 17 00:00:00 2001 From: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com> Date: Tue, 28 May 2024 22:45:37 +0300 Subject: [PATCH 2/2] target/riscv: do not emit warnings when a non-existent CSR is hidden hide_csrs should not emit warnings on an attempt to hide non-exitents CSR. hide_csrs funcitonality is intended to be used for scenarios when we don`t want certain groups of registers to be available in GDB. Typically this is needed to simplify integration with various IDE. In such scenarious it may be impractical/unfeseable to figure out which register is present on a target. So reporting a situation when a user wants to hide a non-existent register creates way too much noise. This commit reduces severity of relevant debug message to LOG_TARGET_DEBUG Change-Id: Icbb982c4bcce7586fe35b6b004d0874d6014d5a7 --- src/target/riscv/riscv_reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/riscv/riscv_reg.c b/src/target/riscv/riscv_reg.c index eefd4029a..4f386f47c 100644 --- a/src/target/riscv/riscv_reg.c +++ b/src/target/riscv/riscv_reg.c @@ -756,7 +756,7 @@ void riscv_reg_impl_hide_csrs(const struct target *target) struct reg * const reg = riscv_reg_impl_cache_entry(target, regno); const unsigned int csr_number = regno - GDB_REGNO_CSR0; if (!reg->exist) { - LOG_TARGET_WARNING(target, + LOG_TARGET_DEBUG(target, "Not hiding CSR %d: register does not exist.", csr_number); continue;