target/riscv: Set VS bits in mideleg for Hyp extension

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Alistair Francis 2020-01-31 17:02:15 -08:00 committed by Palmer Dabbelt
parent 66e594f280
commit 713d8363de
No known key found for this signature in database
GPG Key ID: 2E1319F35FBB1889

View File

@ -448,6 +448,9 @@ static int read_mideleg(CPURISCVState *env, int csrno, target_ulong *val)
static int write_mideleg(CPURISCVState *env, int csrno, target_ulong val) static int write_mideleg(CPURISCVState *env, int csrno, target_ulong val)
{ {
env->mideleg = (env->mideleg & ~delegable_ints) | (val & delegable_ints); env->mideleg = (env->mideleg & ~delegable_ints) | (val & delegable_ints);
if (riscv_has_ext(env, RVH)) {
env->mideleg |= VS_MODE_INTERRUPTS;
}
return 0; return 0;
} }