diff options
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index dcb996bfafa4..917672f8034a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1542,7 +1542,8 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm) | |||
1542 | &ka->master_cycle_now); | 1542 | &ka->master_cycle_now); |
1543 | 1543 | ||
1544 | ka->use_master_clock = host_tsc_clocksource && vcpus_matched | 1544 | ka->use_master_clock = host_tsc_clocksource && vcpus_matched |
1545 | && !backwards_tsc_observed; | 1545 | && !backwards_tsc_observed |
1546 | && !ka->boot_vcpu_runs_old_kvmclock; | ||
1546 | 1547 | ||
1547 | if (ka->use_master_clock) | 1548 | if (ka->use_master_clock) |
1548 | atomic_set(&kvm_guest_has_master_clock, 1); | 1549 | atomic_set(&kvm_guest_has_master_clock, 1); |
@@ -2174,8 +2175,20 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) | |||
2174 | case MSR_KVM_SYSTEM_TIME_NEW: | 2175 | case MSR_KVM_SYSTEM_TIME_NEW: |
2175 | case MSR_KVM_SYSTEM_TIME: { | 2176 | case MSR_KVM_SYSTEM_TIME: { |
2176 | u64 gpa_offset; | 2177 | u64 gpa_offset; |
2178 | struct kvm_arch *ka = &vcpu->kvm->arch; | ||
2179 | |||
2177 | kvmclock_reset(vcpu); | 2180 | kvmclock_reset(vcpu); |
2178 | 2181 | ||
2182 | if (vcpu->vcpu_id == 0 && !msr_info->host_initiated) { | ||
2183 | bool tmp = (msr == MSR_KVM_SYSTEM_TIME); | ||
2184 | |||
2185 | if (ka->boot_vcpu_runs_old_kvmclock != tmp) | ||
2186 | set_bit(KVM_REQ_MASTERCLOCK_UPDATE, | ||
2187 | &vcpu->requests); | ||
2188 | |||
2189 | ka->boot_vcpu_runs_old_kvmclock = tmp; | ||
2190 | } | ||
2191 | |||
2179 | vcpu->arch.time = data; | 2192 | vcpu->arch.time = data; |
2180 | kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu); | 2193 | kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu); |
2181 | 2194 | ||