|
From: | Richard Henderson |
Subject: | Re: [PATCH v2 03/24] target/riscv: save and restore elp state on priv transitions |
Date: | Tue, 30 Jul 2024 09:04:29 +1000 |
User-agent: | Mozilla Thunderbird |
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~
[Prev in Thread] | Current Thread | [Next in Thread] |