aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2007-09-11 08:02:09 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-12 12:28:06 -0400
commit95b08679963c78ce0d675224a6efdb5169f2bf75 (patch)
tree2b242803ab4f54333f874ffcf237fc9c7427a0a7 /arch
parent99364df764bbef327be2f8b8ffcfbb41a4a1af4d (diff)
x86_64: 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 this down. Signed-off-by: Andi Kleen <ak@suse.de> Cc: Chuck Ebbert <cebbert@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/vdso/vclock_gettime.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86_64/vdso/vclock_gettime.c b/arch/x86_64/vdso/vclock_gettime.c
index 17f6a00de712..5b54cdfb2b07 100644
--- a/arch/x86_64/vdso/vclock_gettime.c
+++ b/arch/x86_64/vdso/vclock_gettime.c
@@ -34,10 +34,11 @@ static long vdso_fallback_gettime(long clock, struct timespec *ts)
34 34
35static inline long vgetns(void) 35static inline long vgetns(void)
36{ 36{
37 long v;
37 cycles_t (*vread)(void); 38 cycles_t (*vread)(void);
38 vread = gtod->clock.vread; 39 vread = gtod->clock.vread;
39 return ((vread() - gtod->clock.cycle_last) * gtod->clock.mult) >> 40 v = (vread() - gtod->clock.cycle_last) & gtod->clock.mask;
40 gtod->clock.shift; 41 return (v * gtod->clock.mult) >> gtod->clock.shift;
41} 42}
42 43
43static noinline int do_realtime(struct timespec *ts) 44static noinline int do_realtime(struct timespec *ts)