|
@@ -583,6 +583,10 @@ void sbi_pmu_exit(struct sbi_scratch *scratch)
|
|
|
{
|
|
|
u32 hartid = current_hartid();
|
|
|
|
|
|
+ /* SBI PMU is not supported if mcountinhibit is not available */
|
|
|
+ if (!sbi_hart_has_feature(scratch, SBI_HART_HAS_MCOUNTINHIBIT))
|
|
|
+ return;
|
|
|
+
|
|
|
csr_write(CSR_MCOUNTINHIBIT, 0xFFFFFFF8);
|
|
|
csr_write(CSR_MCOUNTEREN, 7);
|
|
|
pmu_reset_event_map(hartid);
|