diff options
Diffstat (limited to 'arch/x86/kernel/time.c')
| -rw-r--r-- | arch/x86/kernel/time.c | 24 | 
1 files changed, 23 insertions, 1 deletions
| diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c index be01328eb755..0e14f6c0d35e 100644 --- a/arch/x86/kernel/time.c +++ b/arch/x86/kernel/time.c @@ -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; +	} +} |