mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 13:46:24 +00:00
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:
parent
99364df764
commit
95b0867996
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue