mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
target/riscv/kvm: add missing KVM CSRs
We're missing scounteren and senvcfg CSRs, both already present in the KVM UAPI. Signed-off-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Acked-by: Alistair Francis <[email protected]> Message-ID: <[email protected]> Signed-off-by: Alistair Francis <[email protected]>
This commit is contained in:
1 parent
a1e61fc44b
commit
4db19d5b21
1 file changed
+6
@@ -624,6 +624,8 @@ static void kvm_riscv_reset_regs_csr(CPURISCVState *env)
|
||||
env->stval = 0;
|
||||
env->mip = 0;
|
||||
env->satp = 0;
|
||||
env->scounteren = 0;
|
||||
env->senvcfg = 0;
|
||||
}
|
||||
|
||||
static int kvm_riscv_get_regs_csr(CPUState *cs)
|
||||
@@ -639,6 +641,8 @@ static int kvm_riscv_get_regs_csr(CPUState *cs)
|
||||
KVM_RISCV_GET_CSR(cs, env, stval, env->stval);
|
||||
KVM_RISCV_GET_CSR(cs, env, sip, env->mip);
|
||||
KVM_RISCV_GET_CSR(cs, env, satp, env->satp);
|
||||
KVM_RISCV_GET_CSR(cs, env, scounteren, env->scounteren);
|
||||
KVM_RISCV_GET_CSR(cs, env, senvcfg, env->senvcfg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -656,6 +660,8 @@ static int kvm_riscv_put_regs_csr(CPUState *cs)
|
||||
KVM_RISCV_SET_CSR(cs, env, stval, env->stval);
|
||||
KVM_RISCV_SET_CSR(cs, env, sip, env->mip);
|
||||
KVM_RISCV_SET_CSR(cs, env, satp, env->satp);
|
||||
KVM_RISCV_SET_CSR(cs, env, scounteren, env->scounteren);
|
||||
KVM_RISCV_SET_CSR(cs, env, senvcfg, env->senvcfg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user