On 7/30/24 03:53, Deepak Gupta wrote:
elp state is recorded in *status on trap entry (less privilege to higher
privilege) and restored in elp from *status on trap exit (higher to less
privilege).
Additionally this patch introduces a forward cfi helper function to
determine if current privilege has forward cfi is enabled or not based on
*envcfg (for U, VU, S, VU, HS) or mseccfg csr (for M). For qemu-user, a
new field `ufcfien` is introduced which is by default set to false and
helper function returns value deposited in `ufcfien` for qemu-user.
Why are you using a different field for qemu-user?
Much better to simply configure menvcfg the same as for system mode.
+ return (env->menvcfg & MENVCFG_LPE) ? true : false;
Never use ?: with true/false. Use the correct boolean expression in the first place,
which in this case is just the & expression.
r~