lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features

If a hart implements privileged spec v1.10 (or higher) then we can
safely assume that [m|s]counteren CSR are present and we don't need
MCOUNTEREN and SCOUNTEREN as hart features.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
This commit is contained in:
Anup Patel
2022-04-28 18:31:57 +05:30
committed by Anup Patel
parent 5b8b377178
commit d4b563c881
4 changed files with 16 additions and 38 deletions

View File

@@ -733,7 +733,8 @@ void sbi_pmu_exit(struct sbi_scratch *scratch)
if (sbi_hart_has_feature(scratch, SBI_HART_HAS_MCOUNTINHIBIT))
csr_write(CSR_MCOUNTINHIBIT, 0xFFFFFFF8);
csr_write(CSR_MCOUNTEREN, -1);
if (sbi_hart_priv_version(scratch) >= SBI_HART_PRIV_VER_1_10)
csr_write(CSR_MCOUNTEREN, -1);
pmu_reset_event_map(hartid);
}