diff options
author | Andi Kleen <ak@suse.de> | 2006-12-06 20:14:05 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-12-06 20:14:05 -0500 |
commit | 770d132f03ac15b12919f1bac481f4beda13e094 (patch) | |
tree | fdf8470cd380f2db1960102c928806f687f72938 | |
parent | ea7322decb974a4a3e804f96a0201e893ff88ce3 (diff) |
[PATCH] i386: Retrieve CLFLUSH size from CPUID
Also report it in /proc/cpuinfo similar to x86-64.
Needed for followon patch
Signed-off-by: Andi Kleen <ak@suse.de>
-rw-r--r-- | arch/i386/kernel/cpu/common.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/proc.c | 3 | ||||
-rw-r--r-- | include/asm-i386/processor.h | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index 6958ae5e2fa5..cda41aef79ad 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c | |||
@@ -309,6 +309,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 * c) | |||
309 | #else | 309 | #else |
310 | c->apicid = (ebx >> 24) & 0xFF; | 310 | c->apicid = (ebx >> 24) & 0xFF; |
311 | #endif | 311 | #endif |
312 | if (c->x86_capability[0] & (1<<19)) | ||
313 | c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8; | ||
312 | } else { | 314 | } else { |
313 | /* Have CPUID level 0 only - unheard of */ | 315 | /* Have CPUID level 0 only - unheard of */ |
314 | c->x86 = 4; | 316 | c->x86 = 4; |
@@ -373,6 +375,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c) | |||
373 | c->x86_vendor_id[0] = '\0'; /* Unset */ | 375 | c->x86_vendor_id[0] = '\0'; /* Unset */ |
374 | c->x86_model_id[0] = '\0'; /* Unset */ | 376 | c->x86_model_id[0] = '\0'; /* Unset */ |
375 | c->x86_max_cores = 1; | 377 | c->x86_max_cores = 1; |
378 | c->x86_clflush_size = 32; | ||
376 | memset(&c->x86_capability, 0, sizeof c->x86_capability); | 379 | memset(&c->x86_capability, 0, sizeof c->x86_capability); |
377 | 380 | ||
378 | if (!have_cpuid_p()) { | 381 | if (!have_cpuid_p()) { |
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c index 76aac088a323..6624d8583c42 100644 --- a/arch/i386/kernel/cpu/proc.c +++ b/arch/i386/kernel/cpu/proc.c | |||
@@ -152,9 +152,10 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
152 | seq_printf(m, " [%d]", i); | 152 | seq_printf(m, " [%d]", i); |
153 | } | 153 | } |
154 | 154 | ||
155 | seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n", | 155 | seq_printf(m, "\nbogomips\t: %lu.%02lu\n", |
156 | c->loops_per_jiffy/(500000/HZ), | 156 | c->loops_per_jiffy/(500000/HZ), |
157 | (c->loops_per_jiffy/(5000/HZ)) % 100); | 157 | (c->loops_per_jiffy/(5000/HZ)) % 100); |
158 | seq_printf(m, "clflush size\t: %u\n\n", c->x86_clflush_size); | ||
158 | 159 | ||
159 | return 0; | 160 | return 0; |
160 | } | 161 | } |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index f73cf836e649..98fa73b71760 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -72,6 +72,7 @@ struct cpuinfo_x86 { | |||
72 | #endif | 72 | #endif |
73 | unsigned char x86_max_cores; /* cpuid returned max cores value */ | 73 | unsigned char x86_max_cores; /* cpuid returned max cores value */ |
74 | unsigned char apicid; | 74 | unsigned char apicid; |
75 | unsigned short x86_clflush_size; | ||
75 | #ifdef CONFIG_SMP | 76 | #ifdef CONFIG_SMP |
76 | unsigned char booted_cores; /* number of cores as seen by OS */ | 77 | unsigned char booted_cores; /* number of cores as seen by OS */ |
77 | __u8 phys_proc_id; /* Physical processor id. */ | 78 | __u8 phys_proc_id; /* Physical processor id. */ |