Skip to content
Snippets Groups Projects
Commit ace54453 authored by Georg Kotheimer's avatar Georg Kotheimer Committed by Alistair Francis
Browse files

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.

Signed-off-by: default avatarGeorg Kotheimer <georg.kotheimer@kernkonzept.com>
Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
Message-id: 20201013151054.396481-1-georg.kotheimer@kernkonzept.com
Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
parent 801da170
No related branches found
No related tags found
No related merge requests found
......@@ -938,7 +938,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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment