x86: kvmclock: abolish PVCLOCK_COUNTS_FROM_ZERO
authorRadim Krčmář <rkrcmar@redhat.com>
Fri, 18 Sep 2015 15:54:29 +0000 (17:54 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 1 Oct 2015 13:06:42 +0000 (15:06 +0200)
commit72c930dcfc2b49404ee9e20f6c868402e9c71166
tree83ff98a7c359fef9f294bbca18529bca8caf7a27
parent1cea0ce68ed76490ffa64a9e2a7a40104efe9352
x86: kvmclock: abolish PVCLOCK_COUNTS_FROM_ZERO

Newer KVM won't be exposing PVCLOCK_COUNTS_FROM_ZERO anymore.
The purpose of that flags was to start counting system time from 0 when
the KVM clock has been initialized.
We can achieve the same by selecting one read as the initial point.

A simple subtraction will work unless the KVM clock count overflows
earlier (has smaller width) than scheduler's cycle count.  We should be
safe till x86_128.

Because PVCLOCK_COUNTS_FROM_ZERO was enabled only on new hypervisors,
setting sched clock as stable based on PVCLOCK_TSC_STABLE_BIT might
regress on older ones.

I presume we don't need to change kvm_clock_read instead of introducing
kvm_sched_clock_read.  A problem could arise in case sched_clock is
expected to return the same value as get_cycles, but we should have
merged those clocks in that case.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/kvmclock.c
This page took 0.025161 seconds and 5 git commands to generate.