mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
target/arm/kvm: Implement virtual time adjustment
When a VM is stopped (such as when it's paused) guest virtual time should stop counting. Otherwise, when the VM is resumed it will experience time jumps and its kernel may report soft lockups. Not counting virtual time while the VM is stopped has the side effect of making the guest's time appear to lag when compared with real time, and even with time derived from the physical counter. For this reason, this change, which is enabled by default, comes with a KVM CPU feature allowing it to be disabled, restoring legacy behavior. This patch only provides the implementation of the virtual time adjustment. A subsequent patch will provide the CPU property allowing the change to be enabled and disabled. Reported-by: Bijan Mottahedeh <bijan.mottahedeh@oracle.com> Signed-off-by: Andrew Jones <drjones@redhat.com> Message-id: 20200120101023.16030-6-drjones@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
789a35efb5
commit
e5ac4200b4
6 changed files with 150 additions and 0 deletions
|
@ -642,6 +642,12 @@ static int cpu_pre_save(void *opaque)
|
|||
/* This should never fail */
|
||||
abort();
|
||||
}
|
||||
|
||||
/*
|
||||
* kvm_arm_cpu_pre_save() must be called after
|
||||
* write_kvmstate_to_list()
|
||||
*/
|
||||
kvm_arm_cpu_pre_save(cpu);
|
||||
} else {
|
||||
if (!write_cpustate_to_list(cpu, false)) {
|
||||
/* This should never fail. */
|
||||
|
@ -744,6 +750,7 @@ static int cpu_post_load(void *opaque, int version_id)
|
|||
* we're using it.
|
||||
*/
|
||||
write_list_to_cpustate(cpu);
|
||||
kvm_arm_cpu_post_load(cpu);
|
||||
} else {
|
||||
if (!write_list_to_cpustate(cpu)) {
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue