-
Notifications
You must be signed in to change notification settings - Fork 256
Description
Bug Description:
According to the RISC-V Privileged Specification:
An xRET instruction can be executed in
privilege mode x or higher, where executing a lower-privilege xRET instruction will pop the relevant
lower-privilege interrupt enable and privilege mode stack. Attempting to execute an xRET instruction in
a mode less privileged than x will raise an illegal-instruction exception. In addition to manipulating the
privilege stack as described in Section 3.1.6.1, xRET sets the pc to the value stored in the xepc register.
However, NutShell executes the SRET instruction in U-mode without raising an illegal-instruction exception, which violates the RISC-V privileged specification and also differs from the behavior of the Spike reference model.
Test program and log information: test_sret.zip
Inconsistent information:
Environment:
NutShell: commit e315a27