Skip to content

Commit 3e600c7

Browse files
author
wangyang
committed
riscv: gate counter CSRs on mcounteren at every priv version
1 parent 7c5db94 commit 3e600c7

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

qemu/target/riscv/csr.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,6 @@ static int ctr(CPURISCVState *env, int csrno)
458458
return -1;
459459
}
460460

461-
/*
462-
* The counters are always enabled at run time on newer priv specs, as the
463-
* CSR has changed from controlling that the counters can be read to
464-
* controlling that the counters increment.
465-
*/
466-
if (env->priv_ver > PRIV_VERSION_1_09_1) {
467-
return 0;
468-
}
469-
470461
if (env->priv < PRV_M) {
471462
ctr_en &= env->mcounteren;
472463
}

0 commit comments

Comments
 (0)