Closed mndstrmr closed 1 month ago
I don't think 1 should affect CHERIoT Ibex, since we have no modes other than M and therefore can't transition to them, though it may affect non-CHERIoT Ibex.
MRET will set the new privilege level to mstatus.mpp
, which is initialised as PRIV_LVL_U
, which unless I am missing something means one can easily enter unprivileged mode. I can find a full trace if you like.
1. The RTL should clear the mstatus MPRV if the new privilege level is not machine.
This is a difference between version 1.11 and 1.12 of the privileged specification. Upstream this has already been fixed: https://github.com/lowRISC/ibex/commit/423264ce5fd6b3ca560cae1749d86dbcfdd794a7 I suggest that we stay with version 1.11 for CHERIoT Ibex unless we want to rebase on upstream.
RTL commit 4a739b4 changed the behavior of MRET to throw a CHERI exception (mcause = 0x1c, mtval =0x418) for MRET without ASR permission.
Fix is correct, thanks.
Just realised the first issue hasn't been fixed yet.
Good point.. will try to merge in the ibex fix pointed out by Marno.
@mndstrmr , I have made an RTL update (876a46a to include the mprv fix. Please verify.
This proves, thanks.
The MRet instruction differs between RTL and Sail in two ways: