Skip to contentSkip to conversation

include: Adjust Sscofpmf mhpmevent mask for upper 8 bits

PATCH New Eric Lin 2 participants 2 messages Jul 30, 2024 RISC-V

lore
Share & tools
lore

Eric Lin

author
#0 lore raw

PATCH 1/1 include: Adjust Sscofpmf mhpmevent mask for upper 8 bits

Currently, OpenSBI reserves the upper 16 bits in mhpmevent for the Sscofpmf extension.

However, according to the Sscofpmf extension specification[1], it only defines the upper 8 bits in mhpmevent for privilege mode inhibit and counter overflow disable. Other bits are defined by the platform for event selection.

Since vendors might define raw event encoding exceeding 48 bits in mhpmevent, we should adjust the MHPMEVENT_SSCOF_MASK to support it.

---
 include/sbi/riscv_encoding.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/sbi/riscv_encoding.h +1 -1
index 477fa3a1..2ed05f24 100644
@@ -207,7 +207,7 @@
 
 #endif
 
-#define MHPMEVENT_SSCOF_MASK		_ULL(0xFFFF000000000000)
+#define MHPMEVENT_SSCOF_MASK		_ULL(0xFF00000000000000)
 
 #define ENVCFG_STCE			(_ULL(1) << 63)
 #define ENVCFG_PBMTE			(_ULL(1) << 62)
Signature · 1 line
2.43.2
#1 lore raw

PATCH 1/1 include: Adjust Sscofpmf mhpmevent mask for upper 8 bits

? 2024-07-30???? 17:24 +0800?Eric Lin???

Quoted 8 lines

Currently, OpenSBI reserves the upper 16 bits in mhpmevent for the Sscofpmf extension.

However, according to the Sscofpmf extension specification[1], it only defines the upper 8 bits in mhpmevent for privilege mode inhibit and counter overflow disable. Other bits are defined by the platform for event selection.

Quoted 5 lines

Since vendors might define raw event encoding exceeding 48 bits in mhpmevent, we should adjust the MHPMEVENT_SSCOF_MASK to support it.

LGTM

Quoted 21 lines

---
?include/sbi/riscv_encoding.h | 2 +-
?1 file changed, 1 insertion(+), 1 deletion(-)

include/sbi/riscv_encoding.h +0 -0
index 477fa3a1..2ed05f24 100644
@@ -207,7 +207,7 @@

?
?#endif
?

include/sbi/riscv_encoding.h +1 -1
-#define MHPMEVENT_SSCOF_MASK		_ULL(0xFFFF000000000000)
+#define MHPMEVENT_SSCOF_MASK		_ULL(0xFF00000000000000)

?
?#define ENVCFG_STCE (_ULL(1) << 63)
?#define ENVCFG_PBMTE (_ULL(1) << 62)

Signature · 1 line
2.43.2