itrigger_enabled should be set if the privilege does match. The test is
inverted.

Signed-off-by: Nicholas Piggin <[email protected]>
---
 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


Reply via email to