dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Andi Kleen 2007-09-11 14:02:09 +02:00 committed by Linus Torvalds
parent 99364df764
commit 95b0867996
1 changed files with 3 additions and 2 deletions

View File

@ -34,10 +34,11 @@ static long vdso_fallback_gettime(long clock, struct timespec *ts)
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)