diff options
author | Andrew Jones | 2020-01-30 17:02:06 +0100 |
---|---|---|
committer | Peter Maydell | 2020-01-30 17:02:06 +0100 |
commit | e5ac4200b4cddf44df9adbef677af0d1f1c579c6 (patch) | |
tree | 5637c03cc1e04a6e25841a29f1c24de550f86346 /target/arm/cpu.h | |
parent | tests/arm-cpu-features: Check feature default values (diff) | |
download | qemu-e5ac4200b4cddf44df9adbef677af0d1f1c579c6.tar.gz qemu-e5ac4200b4cddf44df9adbef677af0d1f1c579c6.tar.xz qemu-e5ac4200b4cddf44df9adbef677af0d1f1c579c6.zip |
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>
Diffstat (limited to 'target/arm/cpu.h')
-rw-r--r-- | target/arm/cpu.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/target/arm/cpu.h b/target/arm/cpu.h index c1aedbeac0..608fcbd0b7 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -821,6 +821,13 @@ struct ARMCPU { /* KVM init features for this CPU */ uint32_t kvm_init_features[7]; + /* KVM CPU state */ + + /* KVM virtual time adjustment */ + bool kvm_adjvtime; + bool kvm_vtime_dirty; + uint64_t kvm_vtime; + /* Uniprocessor system with MP extensions */ bool mp_is_up; |