On Fri, Aug 16, 2024 at 12:59:43PM +1000, Richard Henderson wrote:
On 8/16/24 11:06, Deepak Gupta wrote:@@ -546,6 +575,15 @@ void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env) } bool current_virt = env->virt_enabled; + /* + * If zicfilp extension available and henvcfg.LPE = 1, + * then apply SPELP mask on mstatus + */ + if (env_archcpu(env)->cfg.ext_zicfilp && + get_field(env->henvcfg, HENVCFG_LPE)) { + mstatus_mask |= SSTATUS_SPELP; + } +I think this hunk belongs with the previous patch.
I kept it here because this save/restore of vsstatus with effective sstatus during VS/VU <--> HS transition. ELP also needs to get saved/restored during these transitions.
Otherwise. Reviewed-by: Richard Henderson <[email protected]> r~
