Red Hat Bugzilla – Bug 581396
[PATCH][RHEL5.5] Fix Time drift on KVM x86_64 RHEL5.5 Guest using PV clock
Last modified: 2013-01-09 17:26:11 EST
Description of problem:
On KVM x86_64 RHEL5.5 Guest with clock=tsccount kernel parameter, time
I verified same problem with 2.6.18-164.2.1.el5 or later version.
Jiffies are calculated with cycles_per_tick and
cycles_per_tick is incorrect value in x86_64 KVM Guest using
clock=tsccount kernel parameter.
I made a patch to fix this problem.
Set x86_64 KVM Guest kernel parameter clocl=tsccount.
Steps to Reproduce:
1. set x86_64 KVM Guest kernel parameter clock=tsccount
2. date; sleep 2; date; sleep 2; ......
3. check speed of date command output
There is not time drift with kerenel-2.6.18-164.el5.
Created attachment 405894 [details]
fixed for calculating cycles_per_tick
The problem is valid, but the patch is wrong.
It totally breaks kvmclock. I am cooking up a new one, and will submit for inclusion soon.
You can download this test kernel from http://people.redhat.com/jwilson/el5
Detailed testing feedback is always welcomed.
I understand that it is the following thing, am I right?
[when kernel version is kernel-2.6.18-164.2.1.el5 or later version]
1) use_kvm_time = 1 && timekeeping_use_tsc = 1
=> use hypervisor clock(cycles per tick = hv_clock cycle)
2) use_kvm_time = 0 && timekeeping_use_tsc = 1
=> use tsc directly(cycles per tick = cpu_khz(or tsc_khz))
I tested using kernel-2.6.18-206.el5 and verified problem was fixed.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.