File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -825,7 +825,7 @@ void riscv_set_mode(CPUState *env, target_ulong newpriv)
825
825
826
826
target_ulong helper_sret (CPUState * env , target_ulong cpu_pc_deb )
827
827
{
828
- if (env -> priv != PRV_S ) {
828
+ if (env -> priv < PRV_S ) {
829
829
tlib_printf (LOG_LEVEL_ERROR , "Trying to execute Sret from privilege level %u" , env -> priv );
830
830
helper_raise_illegal_instruction (env );
831
831
}
@@ -862,7 +862,7 @@ target_ulong helper_sret(CPUState *env, target_ulong cpu_pc_deb)
862
862
863
863
target_ulong helper_mret (CPUState * env , target_ulong cpu_pc_deb )
864
864
{
865
- if (env -> priv != PRV_M ) {
865
+ if (env -> priv < PRV_M ) {
866
866
tlib_printf (LOG_LEVEL_ERROR , "Trying to execute Mret from privilege level %u" , env -> priv );
867
867
helper_raise_illegal_instruction (env );
868
868
}
You can’t perform that action at this time.
0 commit comments