target/riscv KVM_RISCV_SET_TIMER macro is not configured correctly Description of problem: When riscv kvm vm state changed, guest virtual time would stop/continue. But KVM_RISCV_SET_TIMER is wrong, qemu-kvm can only set 'time'. Steps to reproduce: 1.start host kernel 2.start qemu-kvm Additional information: Below code has some probelm: ``` =================================================================== #define KVM_RISCV_SET_TIMER(cs, env, name, reg) \ do { \ int ret = kvm_set_one_reg(cs, RISCV_TIMER_REG(env, time), ®); \ =================================================================== ``` I think it should be like this: ``` diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c index 30f21453d6..0c567f668c 100644 --- a/target/riscv/kvm.c +++ b/target/riscv/kvm.c @@ -99,7 +99,7 @@ static uint64_t kvm_riscv_reg_id(CPURISCVState *env, uint64_t type, #define KVM_RISCV_SET_TIMER(cs, env, name, reg) \ do { \ - int ret = kvm_set_one_reg(cs, RISCV_TIMER_REG(env, time), ®); \ + int ret = kvm_set_one_reg(cs, RISCV_TIMER_REG(env, name), ®); \ if (ret) { \ abort(); \ } \ ```