x86: do not enable TSC notifier if we don't need it

Impact: crash on non-TSC-equipped CPUs

Don't enable the TSC notifier if we *either*:

1. don't have a CPU, or
2. have a CPU with constant TSC.

In either of those cases, the notifier is either damaging (1) or useless(2).

From: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>

authored by Linus Torvalds and committed by H. Peter Anvin 060700b5 8735728e

+4
+4
arch/x86/kernel/tsc.c
··· 325 325 326 326 static int __init cpufreq_tsc(void) 327 327 { 328 + if (!cpu_has_tsc) 329 + return 0; 330 + if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) 331 + return 0; 328 332 cpufreq_register_notifier(&time_cpufreq_notifier_block, 329 333 CPUFREQ_TRANSITION_NOTIFIER); 330 334 return 0;