From: Lin Ming Subject: timekeeping: Fix clock_gettime vsyscall time warp Patch-mainline: 0696b711e4be45fa104c12329f617beb29c03f78 References: bnc#569238 commit 0696b711e4be45fa104c12329f617beb29c03f78 Author: Lin Ming Date: Tue Nov 17 13:49:50 2009 +0800 timekeeping: Fix clock_gettime vsyscall time warp Since commit 0a544198 "timekeeping: Move NTP adjusted clock multiplier to struct timekeeper" the clock multiplier of vsyscall is updated with the unmodified clock multiplier of the clock source and not with the NTP adjusted multiplier of the timekeeper. This causes user space observerable time warps: new CLOCK-warp maximum: 120 nsecs, 00000025c337c537 -> 00000025c337c4bf Add a new argument "mult" to update_vsyscall() and hand in the timekeeping internal NTP adjusted multiplier. Signed-off-by: Lin Ming Cc: "Zhang Yanmin" Cc: Martin Schwidefsky Cc: Benjamin Herrenschmidt Cc: Tony Luck LKML-Reference: <1258436990.17765.83.camel@minggr.sh.intel.com> Signed-off-by: Thomas Gleixner Signed-off-by: Kurt Garloff Automatically created from "patches.fixes/fix_clock_gettime_vsyscall_time_warp.diff" by xen-port-patches.py --- sle11sp1-2010-03-01.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-11-06 10:52:23.000000000 +0100 +++ sle11sp1-2010-03-01/arch/x86/kernel/vsyscall_64-xen.c 2010-03-01 14:44:50.000000000 +0100 @@ -73,7 +73,8 @@ void update_vsyscall_tz(void) write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags); } -void update_vsyscall(struct timespec *wall_time, struct clocksource *clock) +void update_vsyscall(struct timespec *wall_time, struct clocksource *clock, + u32 mult) { unsigned long flags; @@ -82,7 +83,7 @@ void update_vsyscall(struct timespec *wa vsyscall_gtod_data.clock.vread = clock->vread; vsyscall_gtod_data.clock.cycle_last = clock->cycle_last; vsyscall_gtod_data.clock.mask = clock->mask; - vsyscall_gtod_data.clock.mult = clock->mult; + vsyscall_gtod_data.clock.mult = mult; vsyscall_gtod_data.clock.shift = clock->shift; vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec; vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;