Bug 519771

Summary: pvclock return bogus wallclock values
Product: Red Hat Enterprise Linux 5 Reporter: Glauber Costa <gcosta>
Component: kernelAssignee: Glauber Costa <gcosta>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: dhoward, dzickus, jpirko, lihuang, qcai
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 07:42:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 520417, 524152, 528898    

Description Glauber Costa 2009-08-27 18:48:49 UTC
I've just found a totally nasty bug today with kvmclock, thanks to testing done by lihuang at #476075.

Issue is at follows:

in RHEL5 kernel, __pa can miscalculate the address of C symbols. We have to use __pa_symbol() for that. So we effectively register the wallclock time MSR in the wrong address, and get a bogus value in return.

I haven't seen this before, because userspace uses hwclock program to adjust clock on bootup (which is harmful, because it increases delta between host and guest).

Furthermore, if we disable hwclock and fix the above issue, wall clock will still be wrong in 10 minutes. This is because I failed to adjust an initial base for monotonic clock, making the first interrupt after bootup try to compensate exactly 10 minutes of lost ticks.

Again, the presence of the hwclock utility papered over this.

I already have a patch that fixes both issues.

Comment 3 Don Zickus 2009-09-22 20:17:21 UTC
in kernel-2.6.18-166.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 9 errata-xmlrpc 2010-03-30 07:42:41 UTC
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.

http://rhn.redhat.com/errata/RHSA-2010-0178.html