]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/vsyscall_64.c
Merge commit 'origin/master' into next
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / vsyscall_64.c
index 6f3d3d4cd97338162e6889f4eaae86b744f2a2ab..44153afc9067558cef387ba3237ffcf439ca3800 100644 (file)
@@ -131,7 +131,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;