mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-03 16:05:47 +00:00
target/riscv: Fix update of hstatus.SPVP
When trapping from virt into HS mode, hstatus.SPVP was set to the value of sstatus.SPP, as according to the specification both flags should be set to the same value. However, the assignment of SPVP takes place before SPP itself is updated, which results in SPVP having an outdated value. Backports ace544532c4064e995ef69ec9dc93aad62e19988
This commit is contained in:
parent
4805f204d8
commit
640a26bf58
|
@ -925,7 +925,7 @@ void riscv_cpu_do_interrupt(CPUState *cs)
|
|||
/* Trap into HS mode, from virt */
|
||||
riscv_cpu_swap_hypervisor_regs(env);
|
||||
env->hstatus = set_field(env->hstatus, HSTATUS_SPVP,
|
||||
get_field(env->mstatus, SSTATUS_SPP));
|
||||
env->priv);
|
||||
env->hstatus = set_field(env->hstatus, HSTATUS_SPV,
|
||||
riscv_cpu_virt_enabled(env));
|
||||
|
||||
|
|
Loading…
Reference in a new issue