diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2015-09-18 11:54:30 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-09-28 07:06:37 -0400 |
commit | 9bac175d8ed0b1dd3d3611c0713666b724eeace3 (patch) | |
tree | d36059e4f2db727e978a55eaa8e2009063f944ae | |
parent | 9ffecb10283508260936b96022d4ee43a7798b4c (diff) |
Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR"
Shifting pvclock_vcpu_time_info.system_time on write to KVM system time
MSR is a change of ABI. Probably only 2.6.16 based SLES 10 breaks due
to its custom enhancements to kvmclock, but KVM never declared the MSR
only for one-shot initialization. (Doc says that only one write is
needed.)
This reverts commit b7e60c5aedd2b63f16ef06fde4f81ca032211bc5.
And adds a note to the definition of PVCLOCK_COUNTS_FROM_ZERO.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/include/asm/pvclock-abi.h | 1 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
2 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/include/asm/pvclock-abi.h b/arch/x86/include/asm/pvclock-abi.h index 655e07a48f6c..67f08230103a 100644 --- a/arch/x86/include/asm/pvclock-abi.h +++ b/arch/x86/include/asm/pvclock-abi.h | |||
@@ -41,6 +41,7 @@ struct pvclock_wall_clock { | |||
41 | 41 | ||
42 | #define PVCLOCK_TSC_STABLE_BIT (1 << 0) | 42 | #define PVCLOCK_TSC_STABLE_BIT (1 << 0) |
43 | #define PVCLOCK_GUEST_STOPPED (1 << 1) | 43 | #define PVCLOCK_GUEST_STOPPED (1 << 1) |
44 | /* PVCLOCK_COUNTS_FROM_ZERO broke ABI and can't be used anymore. */ | ||
44 | #define PVCLOCK_COUNTS_FROM_ZERO (1 << 2) | 45 | #define PVCLOCK_COUNTS_FROM_ZERO (1 << 2) |
45 | #endif /* __ASSEMBLY__ */ | 46 | #endif /* __ASSEMBLY__ */ |
46 | #endif /* _ASM_X86_PVCLOCK_ABI_H */ | 47 | #endif /* _ASM_X86_PVCLOCK_ABI_H */ |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 991466bf8dee..92511d4b7236 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1708,8 +1708,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) | |||
1708 | vcpu->pvclock_set_guest_stopped_request = false; | 1708 | vcpu->pvclock_set_guest_stopped_request = false; |
1709 | } | 1709 | } |
1710 | 1710 | ||
1711 | pvclock_flags |= PVCLOCK_COUNTS_FROM_ZERO; | ||
1712 | |||
1713 | /* If the host uses TSC clocksource, then it is stable */ | 1711 | /* If the host uses TSC clocksource, then it is stable */ |
1714 | if (use_master_clock) | 1712 | if (use_master_clock) |
1715 | pvclock_flags |= PVCLOCK_TSC_STABLE_BIT; | 1713 | pvclock_flags |= PVCLOCK_TSC_STABLE_BIT; |
@@ -2007,8 +2005,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) | |||
2007 | &vcpu->requests); | 2005 | &vcpu->requests); |
2008 | 2006 | ||
2009 | ka->boot_vcpu_runs_old_kvmclock = tmp; | 2007 | ka->boot_vcpu_runs_old_kvmclock = tmp; |
2010 | |||
2011 | ka->kvmclock_offset = -get_kernel_ns(); | ||
2012 | } | 2008 | } |
2013 | 2009 | ||
2014 | vcpu->arch.time = data; | 2010 | vcpu->arch.time = data; |