Skip to contentSkip to conversation

lib: sbi: Allow programmable counters to monitor cycle/instret events for Andes PMU

PATCH Superseded Leo Yu-Chi Liang 2 participants 2 messages Mar 24, 2025 – Mar 25, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: sbi: Allow programmable counters to monitor cycle/instret events for Andes PMU

Referencing commit 0c304b661965
("lib: sbi: Allow programmable counters to monitor cycle/instret events") to support this functionality for Andes PMU.

---
 lib/sbi/sbi_pmu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/sbi/sbi_pmu.c +2 -1
index 40b898f..1873f07 100644
@@ -737,7 +737,8 @@ static int pmu_ctr_find_hw(struct sbi_pmu_hart_state *phs,
 	 */
 	fixed_ctr = pmu_ctr_find_fixed_hw(event_idx);
 	if (fixed_ctr >= 0 &&
-	    !sbi_hart_has_extension(scratch, SBI_HART_EXT_SSCOFPMF))
+	    !sbi_hart_has_extension(scratch, SBI_HART_EXT_SSCOFPMF) &&
+	    !sbi_hart_has_extension(scratch, SBI_HART_EXT_XANDESPMU))
 		return pmu_fixed_ctr_update_inhibit_bits(fixed_ctr, flags);
 
 	if (sbi_hart_priv_version(scratch) >= SBI_HART_PRIV_VER_1_11)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 lib: sbi: Allow programmable counters to monitor cycle/instret events for Andes PMU

Quoted 8 lines · Leo Yu-Chi Liang

Referencing commit 0c304b661965
("lib: sbi: Allow programmable counters to monitor cycle/instret events") to support this functionality for Andes PMU.

---
 lib/sbi/sbi_pmu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)