aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-04-16 18:25:05 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:25:05 -0400
commitc29601e9c1e7893d1755364e350c9188bd56d69f (patch)
tree14813ddce4d8897b40cc8b3a2f76ace3ac58b36f
parentdc37db4d8cb376bb67c6357c50d707ced3d71c39 (diff)
[PATCH] x86_64: Support constantly ticking TSCs
On Intel Noconas the TSC ticks with a constant frequency. Don't scale the factor used by udelay when cpufreq changes the frequency. This generalizes an earlier patch by Intel for this. Cc: <venkatesh.pallipadi@intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/x86_64/kernel/setup.c5
-rw-r--r--arch/x86_64/kernel/time.c5
-rw-r--r--include/asm-x86_64/cpufeature.h1
3 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index a191d4831789..b06221e31952 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -855,6 +855,8 @@ static void __init init_intel(struct cpuinfo_x86 *c)
855 855
856 if (c->x86 == 15) 856 if (c->x86 == 15)
857 c->x86_cache_alignment = c->x86_clflush_size * 2; 857 c->x86_cache_alignment = c->x86_clflush_size * 2;
858 if (c->x86 >= 15)
859 set_bit(X86_FEATURE_CONSTANT_TSC, &c->x86_capability);
858} 860}
859 861
860void __init get_cpu_vendor(struct cpuinfo_x86 *c) 862void __init get_cpu_vendor(struct cpuinfo_x86 *c)
@@ -1055,7 +1057,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1055 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1057 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1056 1058
1057 /* Other (Linux-defined) */ 1059 /* Other (Linux-defined) */
1058 "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", NULL, NULL, NULL, NULL, 1060 "cxmmx", NULL, "cyrix_arr", "centaur_mcr", "k8c+",
1061 "constant_tsc", NULL, NULL,
1059 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1062 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1060 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1063 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1061 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1064 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 3bafe438fa75..c7a1b50b4af3 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -614,6 +614,9 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
614 struct cpufreq_freqs *freq = data; 614 struct cpufreq_freqs *freq = data;
615 unsigned long *lpj, dummy; 615 unsigned long *lpj, dummy;
616 616
617 if (cpu_has(&cpu_data[freq->cpu], X86_FEATURE_CONSTANT_TSC))
618 return 0;
619
617 lpj = &dummy; 620 lpj = &dummy;
618 if (!(freq->flags & CPUFREQ_CONST_LOOPS)) 621 if (!(freq->flags & CPUFREQ_CONST_LOOPS))
619#ifdef CONFIG_SMP 622#ifdef CONFIG_SMP
@@ -622,8 +625,6 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
622 lpj = &boot_cpu_data.loops_per_jiffy; 625 lpj = &boot_cpu_data.loops_per_jiffy;
623#endif 626#endif
624 627
625
626
627 if (!ref_freq) { 628 if (!ref_freq) {
628 ref_freq = freq->old; 629 ref_freq = freq->old;
629 loops_per_jiffy_ref = *lpj; 630 loops_per_jiffy_ref = *lpj;
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h
index 0e47a6d53726..e68ad97a6319 100644
--- a/include/asm-x86_64/cpufeature.h
+++ b/include/asm-x86_64/cpufeature.h
@@ -62,6 +62,7 @@
62#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ 62#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */
63#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ 63#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */
64#define X86_FEATURE_K8_C (3*32+ 4) /* C stepping K8 */ 64#define X86_FEATURE_K8_C (3*32+ 4) /* C stepping K8 */
65#define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */
65 66
66/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 67/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
67#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 68#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */