Does MNRET change MRET or SRET?
No. MRET/SRET neither depend on nor change NMIE. MNRET performs RNMI return.
Return from an Smrnmi RNMI handler: restore pc from mnepc and privilege/virtualization state from mnstatus.
MNRET is the M-mode-only return instruction added by Smrnmi. It uses mnepc and mnstatus to return to the interrupted program counter, privilege mode, and virtualization mode, sets mnstatus.NMIE, and clears mstatus.MPRV if returning below M-mode.
Shows only Smrnmi-defined mnepc, MNPP/MNPV, NMIE, and conditional MPRV state.
mnretAssumes Smrnmi, U/S/M and H, with switchable IALIGN. Input is the stored MXLEN-bit mnepc; bit 0 must be zero. MNPV is ignored for MNPP=M. Models the core return; conditional Zicfilp ELP and Smdbltrp/Ssdbltrp MDT/SDT updates are not modeled. Steps are teaching views.
MNRET executes only in M-mode, restores the RNMI-interrupted context using mnepc and mnstatus, and sets NMIE=1.
Assume Smrnmi, execution in M-mode, switchable IALIGN, stored mnepc=0x8042, current IALIGN=32, MNPP=S and MNPV=0. MNRET returns to PC=0x8040 in S-mode, sets NMIE=1 and clears MPRV. With IALIGN=16, PC=0x8042. Conditional ELP/double-trap state is not modeled here.
No. MRET/SRET neither depend on nor change NMIE. MNRET performs RNMI return.