[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 10/12] target/riscv: Add kvm_riscv_get/put_regs_timer

From: Richard Henderson
Subject: Re: [PATCH v2 10/12] target/riscv: Add kvm_riscv_get/put_regs_timer
Date: Mon, 13 Dec 2021 07:19:43 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 12/12/21 9:05 PM, Anup Patel wrote:
+    ret = kvm_get_one_reg(cs, RISCV_TIMER_REG(env, state), &reg);
+    if (ret) {
+        abort();
+    }
+    env->kvm_timer_state = reg;

Please read the timer frequency here.


+    env->kvm_timer_dirty = true;
+static void kvm_riscv_put_regs_timer(CPUState *cs)
+    int ret;
+    uint64_t reg;
+    CPURISCVState *env = &RISCV_CPU(cs)->env;
+    if (!env->kvm_timer_dirty) {
+        return;
+    }

Over here, we should get the timer frequency and abort() with an
error message if it does not match env->kvm_timer_frequency

For now, migration will not work between Hosts with different
timer frequency.

You shouldn't have to do this every "put", only on migration, at which point you can actually signal a migration error rather than aborting directly.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]