Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120768
b: refs/heads/master
c: cb9e35d
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Nov 8, 2008
1 parent da16e8c commit 312d89a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 895e031707954a9ca26ed4f5f794575313854ed1
refs/heads/master: cb9e35dce94a1b9c59d46224e8a94377d673e204
6 changes: 1 addition & 5 deletions trunk/arch/x86/include/asm/tsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ static __always_inline cycles_t vget_cycles(void)
if (!cpu_has_tsc)
return 0;
#endif
rdtsc_barrier();
cycles = (cycles_t)__native_read_tsc();
rdtsc_barrier();

return cycles;
return (cycles_t)__native_read_tsc();
}

extern void tsc_init(void);
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/x86/kernel/vsyscall_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,16 @@ static __always_inline void do_vgettimeofday(struct timeval * tv)
gettimeofday(tv,NULL);
return;
}

/*
* Surround the RDTSC by barriers, to make sure it's not
* speculated to outside the seqlock critical section and
* does not cause time warps:
*/
rdtsc_barrier();
now = vread();
rdtsc_barrier();

base = __vsyscall_gtod_data.clock.cycle_last;
mask = __vsyscall_gtod_data.clock.mask;
mult = __vsyscall_gtod_data.clock.mult;
Expand Down

0 comments on commit 312d89a

Please sign in to comment.