Merge branch 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / x86 / kernel / time.c
index be01328eb755c2277f11e9370d84a480c9b7b302..0e14f6c0d35e0f7ef0998963390eab9587d8186e 100644 (file)
@@ -10,6 +10,7 @@
  *
  */
 
+#include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -25,7 +26,7 @@
 #include <asm/time.h>
 
 #ifdef CONFIG_X86_64
-__visible volatile unsigned long jiffies __cacheline_aligned = INITIAL_JIFFIES;
+__visible volatile unsigned long jiffies __cacheline_aligned_in_smp = INITIAL_JIFFIES;
 #endif
 
 unsigned long profile_pc(struct pt_regs *regs)
@@ -105,3 +106,24 @@ void __init time_init(void)
 {
        late_time_init = x86_late_time_init;
 }
+
+/*
+ * Sanity check the vdso related archdata content.
+ */
+void clocksource_arch_init(struct clocksource *cs)
+{
+       if (cs->archdata.vclock_mode == VCLOCK_NONE)
+               return;
+
+       if (cs->archdata.vclock_mode > VCLOCK_MAX) {
+               pr_warn("clocksource %s registered with invalid vclock_mode %d. Disabling vclock.\n",
+                       cs->name, cs->archdata.vclock_mode);
+               cs->archdata.vclock_mode = VCLOCK_NONE;
+       }
+
+       if (cs->mask != CLOCKSOURCE_MASK(64)) {
+               pr_warn("clocksource %s registered with invalid mask %016llx. Disabling vclock.\n",
+                       cs->name, cs->mask);
+               cs->archdata.vclock_mode = VCLOCK_NONE;
+       }
+}