summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/vdso/vclock_gettime.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/vdso/vclock_gettime.c')
-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 17f6a00de71..5b54cdfb2b0 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)
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)