rpms/kernel/devel linux-2.6-x86_64-vdso-fix-clock-masking.patch, NONE, 1.1 kernel.spec, 1.153, 1.154

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Mon Sep 10 20:35:48 UTC 2007


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13048

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-x86_64-vdso-fix-clock-masking.patch 
Log Message:
* Mon Sep 10 2007 Chuck Ebbert <cebbert at redhat.com>
- fix clock warping on x86_64


linux-2.6-x86_64-vdso-fix-clock-masking.patch:

--- NEW FILE linux-2.6-x86_64-vdso-fix-clock-masking.patch ---
Add missing mask operation to vdso

vdso vgetns() didn't mask the time source offset calculation, which could
lead to time problems with 32bit HPET. Add the masking.

Thanks to Chuck Ebbert for tracking down.

Signed-off-by: Andi Kleen <ak at suse.de>

--- linux.orig/arch/x86_64/vdso/vclock_gettime.c
+++ linux/arch/x86_64/vdso/vclock_gettime.c
@@ -34,10 +34,11 @@ static long vdso_fallback_gettime(long c
 
 static inline long vgetns(void)
 {
+	long v;
 	cycles_t (*vread)(void);
 	vread = gtod->clock.vread;
-	return ((vread() - gtod->clock.cycle_last) * gtod->clock.mult) >>
-		gtod->clock.shift;
+	v = (vread() - gtod->clock.cycle_last) & gtod->clock.mask;
+	return (v * gtod->clock.mult) >> gtod->clock.shift;
 }
 
 static noinline int do_realtime(struct timespec *ts)


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -r1.153 -r1.154
--- kernel.spec	10 Sep 2007 14:43:37 -0000	1.153
+++ kernel.spec	10 Sep 2007 20:35:15 -0000	1.154
@@ -672,6 +672,7 @@
 Patch1525: linux-2.6-skb_copy_and_csum_datagram_iovec.patch
 Patch1530: linux-2.6-x86-fix-hang-on-C7.patch
 Patch1535: linux-2.6-sched-cfs-fix-mc.patch
+Patch1540: linux-2.6-x86_64-vdso-fix-clock-masking.patch
 
 %endif
 
@@ -1211,6 +1212,9 @@
 # fix scheduler on multicore
 ApplyPatch linux-2.6-sched-cfs-fix-mc.patch
 
+# fix x86_64 clock warping
+ApplyPatch linux-2.6-x86_64-vdso-fix-clock-masking.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -1803,6 +1807,9 @@
 
 %changelog
 * Mon Sep 10 2007 Chuck Ebbert <cebbert at redhat.com>
+- fix clock warping on x86_64
+
+* Mon Sep 10 2007 Chuck Ebbert <cebbert at redhat.com>
 - x86: fix debug early boot
 
 * Thu Sep 06 2007 Chuck Ebbert <cebbert at redhat.com>




More information about the fedora-extras-commits mailing list