diff options
Diffstat (limited to 'kvm_x86.c')
-rw-r--r-- | kvm_x86.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -652,13 +652,19 @@ do_set_msr(struct kvm_vcpu *vcpu, unsigned index, uint64_t *data) static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock) { - static int version; + int version; struct pvclock_wall_clock wc; struct timespec boot; if (!wall_clock) return; + if (kvm_read_guest(kvm, wall_clock, &version, sizeof (version)) != 0) + return; + + if (version & 1) + version++; /* first time write, random junk */ + version++; kvm_write_guest(kvm, wall_clock, &version, sizeof (version)); |