]> Pileus Git - ~andy/linux/blobdiff - arch/x86/kernel/vsyscall_64.c
Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / arch / x86 / kernel / vsyscall_64.c
index e50740d32314e2608e13da780fa2c704f2172df4..44153afc9067558cef387ba3237ffcf439ca3800 100644 (file)
@@ -17,6 +17,9 @@
  *  want per guest time just set the kernel.vsyscall64 sysctl to 0.
  */
 
+/* Disable profiling for userspace code: */
+#define DISABLE_BRANCH_PROFILING
+
 #include <linux/time.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -128,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;
@@ -279,7 +291,7 @@ cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg)
 {
        long cpu = (long)arg;
        if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN)
-               smp_call_function_single(cpu, cpu_vsyscall_init, NULL, 0, 1);
+               smp_call_function_single(cpu, cpu_vsyscall_init, NULL, 1);
        return NOTIFY_DONE;
 }
 
@@ -302,7 +314,7 @@ static int __init vsyscall_init(void)
 #ifdef CONFIG_SYSCTL
        register_sysctl_table(kernel_root_table2);
 #endif
-       on_each_cpu(cpu_vsyscall_init, NULL, 0, 1);
+       on_each_cpu(cpu_vsyscall_init, NULL, 1);
        hotcpu_notifier(cpu_vsyscall_notifier, 0);
        return 0;
 }