[RFC PATCH 08/25] target/riscv/debug: Fix icount privilege matching icount_enabled() test

Nicholas Piggin posted 25 patches 3 weeks, 4 days ago
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>
[RFC PATCH 08/25] target/riscv/debug: Fix icount privilege matching icount_enabled() test
Posted by Nicholas Piggin 3 weeks, 4 days ago
itrigger_enabled should be set if the privilege does match. The test is
inverted.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 target/riscv/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/debug.c b/target/riscv/debug.c
index af9c4e37cd..ecedffd3b9 100644
--- a/target/riscv/debug.c
+++ b/target/riscv/debug.c
@@ -679,7 +679,7 @@ bool riscv_itrigger_enabled(CPURISCVState *env)
         if (get_trigger_type(env, i) != TRIGGER_TYPE_INST_CNT) {
             continue;
         }
-        if (check_itrigger_priv(env, i)) {
+        if (!check_itrigger_priv(env, i)) {
             continue;
         }
         count = itrigger_get_count(env, i);
-- 
2.51.0