On 10/28/20 7:42 AM, Alistair Francis wrote:
> +void helper_hyp_access_check(CPURISCVState *env)
>  {
>      if (env->priv == PRV_M ||
>          (env->priv == PRV_S && !riscv_cpu_virt_enabled(env)) ||
>          (env->priv == PRV_U && !riscv_cpu_virt_enabled(env) &&
>              get_field(env->hstatus, HSTATUS_HU))) {
>          return;
>      }

While this works, I think it would be better to compute this into one bit of
TBFLAGS.  Then you can test it during translate and do not need an external
helper at all for the data accesses.

It also means that patch 5 can be simplified...


r~

Reply via email to