mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06: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 <dbarboza@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20250224123120.1644186-4-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
a1e61fc44b
commit
4db19d5b21
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue