[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC v4 15/15] target/riscv: Add time frequency migration support
From: |
Yifei Jiang |
Subject: |
[PATCH RFC v4 15/15] target/riscv: Add time frequency migration support |
Date: |
Thu, 3 Dec 2020 20:47:03 +0800 |
If vcpu's time frequency is not specified by CPU option 'time-frequency'
on the destination, the time frequency of destination will follow
the source.
If vcpu's time frequency specified by CPU option 'time-frequency' on the
destination is different from migrated time frequency. The migration
will be abort.
Signed-off-by: Yifei Jiang <jiangyifei@huawei.com>
Signed-off-by: Yipeng Yin <yinyipeng1@huawei.com>
---
target/riscv/machine.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/target/riscv/machine.c b/target/riscv/machine.c
index ef2d5395a8..6955542fef 100644
--- a/target/riscv/machine.c
+++ b/target/riscv/machine.c
@@ -144,6 +144,13 @@ static int cpu_post_load(void *opaque, int version_id)
CPURISCVState *env = &cpu->env;
env->kvm_timer_dirty = true;
+
+ if (env->user_frequency && env->user_frequency != env->frequency) {
+ error_report("Mismatch between user-specified time frequency and "
+ "migrated time frequency");
+ return -EINVAL;
+ }
+
return 0;
}
@@ -198,6 +205,7 @@ const VMStateDescription vmstate_riscv_cpu = {
VMSTATE_UINT64(env.kvm_timer_time, RISCVCPU),
VMSTATE_UINT64(env.kvm_timer_compare, RISCVCPU),
VMSTATE_UINT64(env.kvm_timer_state, RISCVCPU),
+ VMSTATE_UINT64(env.frequency, RISCVCPU),
VMSTATE_END_OF_LIST()
},
--
2.19.1
- [PATCH RFC v4 11/15] target/riscv: Implement virtual time adjusting with vm state changing, (continued)
- [PATCH RFC v4 11/15] target/riscv: Implement virtual time adjusting with vm state changing, Yifei Jiang, 2020/12/03
- [PATCH RFC v4 10/15] target/riscv: Add kvm_riscv_get/put_regs_timer, Yifei Jiang, 2020/12/03
- [PATCH RFC v4 09/15] target/riscv: Add host cpu type, Yifei Jiang, 2020/12/03
- [PATCH RFC v4 14/15] target/riscv: Synchronize vcpu's frequency with KVM, Yifei Jiang, 2020/12/03
- [PATCH RFC v4 12/15] target/riscv: Support virtual time context synchronization, Yifei Jiang, 2020/12/03
- [PATCH RFC v4 13/15] target/riscv: Introduce dynamic time frequency for virt machine, Yifei Jiang, 2020/12/03
- [PATCH RFC v4 15/15] target/riscv: Add time frequency migration support,
Yifei Jiang <=