aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2008-01-30 07:33:20 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:20 -0500
commit404ee5b14b68d3cba287c2596588b83790c49f7b (patch)
tree6007a5d2c461c3435edbc9335c84ff45ec4715ca /arch/x86
parent8424950b5e85543a494b5d940bb2f5f9f16f56a9 (diff)
x86: convert TSC disabling to generic cpuid disable bitmap
Fix from: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/bugs.c2
-rw-r--r--arch/x86/kernel/cpu/common.c9
-rw-r--r--arch/x86/kernel/numaq_32.c2
-rw-r--r--arch/x86/kernel/tsc_32.c14
-rw-r--r--arch/x86/mach-voyager/setup.c2
-rw-r--r--arch/x86/xen/time.c2
6 files changed, 7 insertions, 24 deletions
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index a96abd453e0d..9b95edcfc6ae 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -154,7 +154,7 @@ static void __init check_config(void)
154 * If we configured ourselves for a TSC, we'd better have one! 154 * If we configured ourselves for a TSC, we'd better have one!
155 */ 155 */
156#ifdef CONFIG_X86_TSC 156#ifdef CONFIG_X86_TSC
157 if (!cpu_has_tsc && !tsc_disable) 157 if (!cpu_has_tsc)
158 panic("Kernel compiled for Pentium+, requires TSC feature!"); 158 panic("Kernel compiled for Pentium+, requires TSC feature!");
159#endif 159#endif
160 160
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index c66991a04a8a..dfc9563fc4f0 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -446,10 +446,6 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
446 * we do "generic changes." 446 * we do "generic changes."
447 */ 447 */
448 448
449 /* TSC disabled? */
450 if ( tsc_disable )
451 clear_bit(X86_FEATURE_TSC, c->x86_capability);
452
453 /* If the model name is still unset, do table lookup. */ 449 /* If the model name is still unset, do table lookup. */
454 if ( !c->x86_model_id[0] ) { 450 if ( !c->x86_model_id[0] ) {
455 char *p; 451 char *p;
@@ -650,11 +646,6 @@ void __cpuinit cpu_init(void)
650 646
651 if (cpu_has_vme || cpu_has_tsc || cpu_has_de) 647 if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
652 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); 648 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
653 if (tsc_disable && cpu_has_tsc) {
654 printk(KERN_NOTICE "Disabling TSC...\n");
655 /**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/
656 clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability);
657 }
658 649
659 load_idt(&idt_descr); 650 load_idt(&idt_descr);
660 switch_to_new_gdt(); 651 switch_to_new_gdt();
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c
index 9000d82c6dc0..e65281b1634b 100644
--- a/arch/x86/kernel/numaq_32.c
+++ b/arch/x86/kernel/numaq_32.c
@@ -82,7 +82,7 @@ static int __init numaq_tsc_disable(void)
82{ 82{
83 if (num_online_nodes() > 1) { 83 if (num_online_nodes() > 1) {
84 printk(KERN_DEBUG "NUMAQ: disabling TSC\n"); 84 printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
85 tsc_disable = 1; 85 setup_clear_cpu_cap(X86_FEATURE_TSC);
86 } 86 }
87 return 0; 87 return 0;
88} 88}
diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c
index 2a7b95bd8509..43517e324be8 100644
--- a/arch/x86/kernel/tsc_32.c
+++ b/arch/x86/kernel/tsc_32.c
@@ -24,8 +24,6 @@ static int tsc_enabled;
24unsigned int tsc_khz; 24unsigned int tsc_khz;
25EXPORT_SYMBOL_GPL(tsc_khz); 25EXPORT_SYMBOL_GPL(tsc_khz);
26 26
27int tsc_disable;
28
29#ifdef CONFIG_X86_TSC 27#ifdef CONFIG_X86_TSC
30static int __init tsc_setup(char *str) 28static int __init tsc_setup(char *str)
31{ 29{
@@ -40,8 +38,7 @@ static int __init tsc_setup(char *str)
40 */ 38 */
41static int __init tsc_setup(char *str) 39static int __init tsc_setup(char *str)
42{ 40{
43 tsc_disable = 1; 41 setup_clear_cpu_cap(X86_FEATURE_TSC);
44
45 return 1; 42 return 1;
46} 43}
47#endif 44#endif
@@ -395,7 +392,7 @@ void __init tsc_init(void)
395{ 392{
396 int cpu; 393 int cpu;
397 394
398 if (!cpu_has_tsc || tsc_disable) 395 if (!cpu_has_tsc)
399 goto out_no_tsc; 396 goto out_no_tsc;
400 397
401 cpu_khz = calculate_cpu_khz(); 398 cpu_khz = calculate_cpu_khz();
@@ -439,10 +436,5 @@ void __init tsc_init(void)
439 return; 436 return;
440 437
441out_no_tsc: 438out_no_tsc:
442 /* 439 setup_clear_cpu_cap(X86_FEATURE_TSC);
443 * Set the tsc_disable flag if there's no TSC support, this
444 * makes it a fast flag for the kernel to see whether it
445 * should be using the TSC.
446 */
447 tsc_disable = 1;
448} 440}
diff --git a/arch/x86/mach-voyager/setup.c b/arch/x86/mach-voyager/setup.c
index 81257a861984..5ae5466b9eb9 100644
--- a/arch/x86/mach-voyager/setup.c
+++ b/arch/x86/mach-voyager/setup.c
@@ -37,7 +37,7 @@ void __init pre_setup_arch_hook(void)
37{ 37{
38 /* Voyagers run their CPUs from independent clocks, so disable 38 /* Voyagers run their CPUs from independent clocks, so disable
39 * the TSC code because we can't sync them */ 39 * the TSC code because we can't sync them */
40 tsc_disable = 1; 40 setup_clear_cpu_cap(X86_FEATURE_TSC);
41} 41}
42 42
43void __init trap_init_hook(void) 43void __init trap_init_hook(void)
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index d083ff5ef088..b3721fd6877b 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -592,7 +592,7 @@ __init void xen_time_init(void)
592 set_normalized_timespec(&wall_to_monotonic, 592 set_normalized_timespec(&wall_to_monotonic,
593 -xtime.tv_sec, -xtime.tv_nsec); 593 -xtime.tv_sec, -xtime.tv_nsec);
594 594
595 tsc_disable = 0; 595 setup_force_cpu_cap(X86_FEATURE_TSC);
596 596
597 xen_setup_timer(cpu); 597 xen_setup_timer(cpu);
598 xen_setup_cpu_clockevents(); 598 xen_setup_cpu_clockevents();