aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/x86.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 78d729174d99..fcce29b7b6fa 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2113,8 +2113,13 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
2113 kvm_x86_ops->vcpu_load(vcpu, cpu); 2113 kvm_x86_ops->vcpu_load(vcpu, cpu);
2114 if (unlikely(vcpu->cpu != cpu) || check_tsc_unstable()) { 2114 if (unlikely(vcpu->cpu != cpu) || check_tsc_unstable()) {
2115 /* Make sure TSC doesn't go backwards */ 2115 /* Make sure TSC doesn't go backwards */
2116 s64 tsc_delta = !vcpu->arch.last_host_tsc ? 0 : 2116 s64 tsc_delta;
2117 native_read_tsc() - vcpu->arch.last_host_tsc; 2117 u64 tsc;
2118
2119 kvm_get_msr(vcpu, MSR_IA32_TSC, &tsc);
2120 tsc_delta = !vcpu->arch.last_guest_tsc ? 0 :
2121 tsc - vcpu->arch.last_guest_tsc;
2122
2118 if (tsc_delta < 0) 2123 if (tsc_delta < 0)
2119 mark_tsc_unstable("KVM discovered backwards TSC"); 2124 mark_tsc_unstable("KVM discovered backwards TSC");
2120 if (check_tsc_unstable()) { 2125 if (check_tsc_unstable()) {