Skip to contentSkip to conversation

include: correct the definition of MSTATUS_VS

PATCH New Vincent Chen 3 participants 3 messages Apr 12, 2022 – Apr 17, 2022 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include: correct the definition of MSTATUS_VS

Accordind to the RISC-V privileged specification, the VS filed is mstatus[10:9] instead of mstatus[24:23]. Modify the MSTATUS_VS to the correct value.

---
 include/sbi/riscv_encoding.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/sbi/riscv_encoding.h +1 -1
index 04d5621..a9772a6 100644
@@ -25,7 +25,7 @@
 #define MSTATUS_MPP			(_UL(3) << MSTATUS_MPP_SHIFT)
 #define MSTATUS_FS			_UL(0x00006000)
 #define MSTATUS_XS			_UL(0x00018000)
-#define MSTATUS_VS			_UL(0x01800000)
+#define MSTATUS_VS			_UL(0x00000600)
 #define MSTATUS_MPRV			_UL(0x00020000)
 #define MSTATUS_SUM			_UL(0x00040000)
 #define MSTATUS_MXR			_UL(0x00080000)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 include: correct the definition of MSTATUS_VS

? 2022-04-12???? 09:16 +0800?Vincent Chen???

Quoted 6 lines

Accordind to the RISC-V privileged specification, the VS filed is mstatus[10:9] instead of mstatus[24:23]. Modify the MSTATUS_VS to the correct value.

Look good to me.

Quoted 21 lines

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

include/sbi/riscv_encoding.h +1 -1
index 04d5621..a9772a6 100644
@@ -25,7 +25,7 @@
 ?#define MSTATUS_MPP????????????????????(_UL(3) << MSTATUS_MPP_SHIFT)
 ?#define MSTATUS_FS?????????????????????_UL(0x00006000)
 ?#define MSTATUS_XS?????????????????????_UL(0x00018000)
-#define MSTATUS_VS?????????????????????_UL(0x01800000)
+#define MSTATUS_VS?????????????????????_UL(0x00000600)
 ?#define MSTATUS_MPRV???????????????????_UL(0x00020000)
 ?#define MSTATUS_SUM????????????????????_UL(0x00040000)
 ?#define MSTATUS_MXR????????????????????_UL(0x00080000)
Signature · 1 line
2.17.1
Applied
#2 lore raw

PATCH 1/1 include: correct the definition of MSTATUS_VS

In reply to Vincent Chen
Quoted 7 lines · Vincent Chen

Accordind to the RISC-V privileged specification, the VS filed is mstatus[10:9] instead of mstatus[24:23]. Modify the MSTATUS_VS to the correct value.

Looks good to me.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 20 lines
---
 include/sbi/riscv_encoding.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/sbi/riscv_encoding.h +1 -2
index 04d5621..a9772a6 100644
@@ -25,7 +25,7 @@
 #define MSTATUS_MPP                    (_UL(3) << MSTATUS_MPP_SHIFT)
 #define MSTATUS_FS                     _UL(0x00006000)
 #define MSTATUS_XS                     _UL(0x00018000)
-#define MSTATUS_VS                     _UL(0x01800000)
+#define MSTATUS_VS                     _UL(0x00000600)
 #define MSTATUS_MPRV                   _UL(0x00020000)
 #define MSTATUS_SUM                    _UL(0x00040000)
 #define MSTATUS_MXR                    _UL(0x00080000)
--

2.17.1