Skip to content

Commit 250e578

Browse files
p-wojadrabarek
authored andcommitted
[#59539] riscv: Clear sstatus.SPP on SRET
1 parent 4f14b6a commit 250e578

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/op_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ target_ulong helper_sret(CPUState *env, target_ulong cpu_pc_deb)
841841
set_field(sstatus, (env->privilege_architecture >= RISCV_PRIV1_10) ? SSTATUS_SIE : 1 << prev_priv,
842842
get_field(sstatus, SSTATUS_SPIE));
843843
sstatus = set_field(sstatus, SSTATUS_SPIE, 1);
844-
sstatus = set_field(sstatus, SSTATUS_SPP, prev_priv);
844+
sstatus = set_field(sstatus, SSTATUS_SPP, PRV_U);
845845
if (env->privilege_architecture >= RISCV_PRIV1_12) {
846846
sstatus = set_field(sstatus, MSTATUS_MPRV, 0);
847847
}

0 commit comments

Comments
 (0)