Skip to contentSkip to conversation

lib: sbi: Fix Priv spec version for [m|s]counteren and mcountinhibit CSRs

PATCH New Ley Foon Tan 2 participants 2 messages Jul 6, 2023 – Jul 9, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lib: sbi: Fix Priv spec version for [m|s]counteren and mcountinhibit CSRs

Fix Priv spec version typo in commit d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features").

At least Priv spec v1.11 is required for [m|s]counteren and mcountinhibit CSRs.

Fixes d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features")

---
v2:
- Change Priv spec version to v1.11.
- Update git commit description.

---
 lib/sbi/sbi_hart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_hart.c +1 -1
index 6e52cbd..d4b8cad 100644
@@ -664,7 +664,7 @@ __mhpm_skip:
 		hfeatures->priv_version = SBI_HART_PRIV_VER_1_12;
 
 	/* Counter overflow/filtering is not useful without mcounter/inhibit */
-	if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_12) {
+	if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_11) {
 		/* Detect if hart supports sscofpmf */
 		csr_read_allowed(CSR_SCOUNTOVF, (unsigned long)&trap);
 		if (!trap.cause)
Signature · 1 line
2.25.1
Applied
#1 lore raw

PATCH v2 1/1 lib: sbi: Fix Priv spec version for [m|s]counteren and mcountinhibit CSRs

Quoted 9 lines · On Thu, Jul 6, 2023 at 12:01?PM Ley Foon Tan <[email protected]>…

Fix Priv spec version typo in commit d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features").

At least Priv spec v1.11 is required for [m|s]counteren and mcountinhibit CSRs.

Fixes d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features")

Looks good to me.

Applied this patch to the riscv/opensbi repo.

Regards,
Anup

Quoted 29 lines

---
v2:
- Change Priv spec version to v1.11.
- Update git commit description.

---
 lib/sbi/sbi_hart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_hart.c +1 -2
index 6e52cbd..d4b8cad 100644
@@ -664,7 +664,7 @@ __mhpm_skip:
                hfeatures->priv_version = SBI_HART_PRIV_VER_1_12;
 
        /* Counter overflow/filtering is not useful without mcounter/inhibit */
-       if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_12) {
+       if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_11) {
                /* Detect if hart supports sscofpmf */
                csr_read_allowed(CSR_SCOUNTOVF, (unsigned long)&trap);
                if (!trap.cause)
--

2.25.1

--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi