tree 0b6b5abbc0655e93aa8c670e630da48499f7d438
parent 7e62f2bb75e39ada8206a7ff3d8722d418399d41
author Andi Kleen <[EMAIL PROTECTED]> Tue Apr 12 08:25:36 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:25:36 2005
[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: <[EMAIL PROTECTED]>
Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
arch/x86_64/kernel/setup.c | 5 ++++-
arch/x86_64/kernel/time.c | 5 +++--
include/asm-x86_64/cpufeature.h | 1 +
3 files changed, 8 insertions(+), 3 deletions(-)
Index: arch/x86_64/kernel/setup.c
===================================================================
--- f26bc67157c308cd93c47bddd59a740e4dcc62dd/arch/x86_64/kernel/setup.c
(mode:100644 sha1:61cdf59c62a7de1281b245e992b077511aefb2a6)
+++ 0b6b5abbc0655e93aa8c670e630da48499f7d438/arch/x86_64/kernel/setup.c
(mode:100644 sha1:aab5afa223cafb0c4218909725f7f39871362d4c)
@@ -855,6 +855,8 @@
if (c->x86 == 15)
c->x86_cache_alignment = c->x86_clflush_size * 2;
+ if (c->x86 >= 15)
+ set_bit(X86_FEATURE_CONSTANT_TSC, &c->x86_capability);
}
void __init get_cpu_vendor(struct cpuinfo_x86 *c)
@@ -1055,7 +1057,8 @@
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* Other (Linux-defined) */
- "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", NULL, NULL,
NULL, NULL,
+ "cxmmx", NULL, "cyrix_arr", "centaur_mcr", "k8c+",
+ "constant_tsc", NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Index: arch/x86_64/kernel/time.c
===================================================================
--- f26bc67157c308cd93c47bddd59a740e4dcc62dd/arch/x86_64/kernel/time.c
(mode:100644 sha1:f13fcb4fdbc187c8183b2bd7ec9b25e78fffbc68)
+++ 0b6b5abbc0655e93aa8c670e630da48499f7d438/arch/x86_64/kernel/time.c
(mode:100644 sha1:279e61b19606855bc0a964260e8b80bfc2d6b3cc)
@@ -614,6 +614,9 @@
struct cpufreq_freqs *freq = data;
unsigned long *lpj, dummy;
+ if (cpu_has(&cpu_data[freq->cpu], X86_FEATURE_CONSTANT_TSC))
+ return 0;
+
lpj = &dummy;
if (!(freq->flags & CPUFREQ_CONST_LOOPS))
#ifdef CONFIG_SMP
@@ -622,8 +625,6 @@
lpj = &boot_cpu_data.loops_per_jiffy;
#endif
-
-
if (!ref_freq) {
ref_freq = freq->old;
loops_per_jiffy_ref = *lpj;
Index: include/asm-x86_64/cpufeature.h
===================================================================
--- f26bc67157c308cd93c47bddd59a740e4dcc62dd/include/asm-x86_64/cpufeature.h
(mode:100644 sha1:80829a469b7519cb758100ca5fb70e1daada0ce8)
+++ 0b6b5abbc0655e93aa8c670e630da48499f7d438/include/asm-x86_64/cpufeature.h
(mode:100644 sha1:caaacaa62e1e96252936a8c339142addf29c6018)
@@ -62,6 +62,7 @@
#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */
#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */
#define X86_FEATURE_K8_C (3*32+ 4) /* C stepping K8 */
+#define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */
/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html