Re: Question about mip and vsip


Oscar Jupp
 

Dear Greg,
Thanks for your reply.
1. You said : “Priv section 9.4.3 defines these bits as aliases (of bits in hip), so yes - M-mode software can modify these bits.” 
But I don’t know they are read-only aliases ? or read-write aliases ? In other word, Can the CSR instruction  with the CSR number 0x344 (mip) modify these bits? Or only CSR instruction with the CSR number 0x644 (hip) can modify these bits?

2. The ISA said : “If implemented, SEIP is read-only in sip."(Priv section 4.3.1)
It means sip.SEIP is read-only for S-mode. Similarly, is vsip.SEIP read-only for VS-mode ?


---- Replied Message ----
From Greg Favor<gfavor@...>
Date 11/27/2022 06:16
To Oscar Jupp<jupposcar@...>
Cc tech-privileged@...<tech-privileged@...>
Subject Re: [RISC-V] [tech-privileged] Question about mip and vsip
On Sat, Nov 26, 2022 at 4:38 AM Oscar Jupp <jupposcar@...> wrote:
Dear architect,
CSR mip and vsip are both WARL. But SPEC did not specify that :
1.  Are the fields VSEIP,VSSIP,VSTIP in mip real-only ? Can M-mode software modify these bit fields?

Priv section 9.4.3 defines these bits as aliases (of bits in hip), so yes - M-mode software can modify these bits.

2.  Are the fields SEIP,SSIP,STIP in vsip real-only ? Can VS-mode software modify these bit fields?

The vsip CSR - as with all vs* CSRs - is only accessible by HS-mode (and M-mode).  As the vsip definition says, "When V=1, vsip and vsie substitute for the usual sip and sie, so instructions that normally read or modify sip/sie actually access vsip/vsie instead."

In other words, VS-mode software (just like S/HS-mode software) has read/write access to sip, but in the case of VS-mode software (i.e. V=1) it actually accesses vsip and not sip.

Greg

Join tech-privileged@lists.riscv.org to automatically receive all group messages.