mirror of
https://github.com/qemu/qemu.git
synced 2024-11-26 21:33:40 +08:00
target/riscv: Set default XLEN for hypervisor
When swap regs for hypervisor, the value of vsstatus or mstatus_hs should have the right XLEN. Otherwise, it will propagate to mstatus. Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20220120122050.41546-22-zhiwei_liu@c-sky.com Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
d8c40c24fd
commit
5a2ae2350e
@ -422,6 +422,16 @@ static void riscv_cpu_reset(DeviceState *dev)
|
||||
*/
|
||||
env->mstatus = set_field(env->mstatus, MSTATUS64_SXL, env->misa_mxl);
|
||||
env->mstatus = set_field(env->mstatus, MSTATUS64_UXL, env->misa_mxl);
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
env->vsstatus = set_field(env->vsstatus,
|
||||
MSTATUS64_SXL, env->misa_mxl);
|
||||
env->vsstatus = set_field(env->vsstatus,
|
||||
MSTATUS64_UXL, env->misa_mxl);
|
||||
env->mstatus_hs = set_field(env->mstatus_hs,
|
||||
MSTATUS64_SXL, env->misa_mxl);
|
||||
env->mstatus_hs = set_field(env->mstatus_hs,
|
||||
MSTATUS64_UXL, env->misa_mxl);
|
||||
}
|
||||
}
|
||||
env->mcause = 0;
|
||||
env->pc = env->resetvec;
|
||||
|
Loading…
Reference in New Issue
Block a user