lib: sbi: Fix Priv spec version for [m|s]counter CSR
PATCH 1/1 lib: sbi: Fix Priv spec version for [m|s]counter CSR
Fix Priv spec version typo in commit d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features"). It should be v1.10.
--- lib/sbi/sbi_hart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_hart.c +1 -1
@@ -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_10 ) {/* Detect if hart supports sscofpmf */ csr_read_allowed (CSR_SCOUNTOVF , (unsigned long )&trap);if (!trap.cause)
Signature · 1 line
2.25.1
PATCH 1/1 lib: sbi: Fix Priv spec version for [m|s]counter CSR
Quoted 15 lines · On Thu, Jul 6, 2023 at 8:35?AM Ley Foon Tan <[email protected]>…
Fix Priv spec version typo in commit
d4b563c881d6("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features"). It should be v1.10.Fixes d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features")Signed-off-by Ley Foon Tan <[email protected]>--- lib/sbi/sbi_hart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/sbi/sbi_hart.c +0
-0
lib/sbi/sbi_hart.c __mhpm_skip: · line 667
Quoted 5 lines
lib/sbi/sbi_hart.c +1
-1@@ -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_10 ) {
There is no mcountinhibit CSR in Priv v1.10 so this does not align with the comment.
The Priv version has to be at least v1.11 and nothing less.
Quoted 11 lines
lib/sbi/sbi_hart.c +0
-1/* 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
Regards,
Anup
PATCH 1/1 lib: sbi: Fix Priv spec version for [m|s]counter CSR
Quoted 30 lines
-----Original Message-----
From: Anup Patel <[email protected]>
Sent: Thursday, July 6, 2023 2:08 PM
To: Leyfoon Tan <[email protected]>
Cc: opensbi at lists.infradead.org; Ley Foon Tan <[email protected]>
Subject: Re: [PATCH] lib: sbi: Fix Priv spec version for [m|s]counter CSRQuoted 5 lines · On Thu, Jul 6, 2023 at 8:35?AM Ley Foon Tan <[email protected]>…
Fix Priv spec version typo in commit
d4b563c881d6("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features"). It should be v1.10.Fixes d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN and SCOUNTERENhart
Quoted 13 lines
features")
Signed-off-by Ley Foon Tan <[email protected]>--- lib/sbi/sbi_hart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/sbi/sbi_hart.c index renamed from lib/sbi/sbi_hart.c +0
-06e52cbd..62e7a4b 100644
lib/sbi/sbi_hart.c +0
-0@@ -664,7 +664,7 @@ __mhpm_skip: hfeatures->priv_version =SBI_HART_PRIV_VER_1_12 ;
Quoted 8 lines
lib/sbi/sbi_hart.c __mhpm_skip: · line 667
Quoted 3 lines
lib/sbi/sbi_hart.c +1
-1/* 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_10 ) {There is no mcountinhibit CSR in Priv v1.10 so this does not align with the comment.
The Priv version has to be at least v1.11 and nothing less.
Okay, will send v2 patch with v1.11.
Regards
Ley Foon