diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-09-04 23:09:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-05 03:40:51 -0400 |
commit | 140fc72709278989f08eb756d16a70008bdcc409 (patch) | |
tree | 801c4ca1fb6228d94fee1d02425f8e57d7849f96 /arch/x86/kernel/cpu/common_64.c | |
parent | b9e67f00424e164dcd29391eb48dc941db8691ad (diff) |
x86: cpu/common*.c, merge display_cacheinfo()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/common_64.c')
-rw-r--r-- | arch/x86/kernel/cpu/common_64.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c index 2fda10974813..f7a2d524b1e7 100644 --- a/arch/x86/kernel/cpu/common_64.c +++ b/arch/x86/kernel/cpu/common_64.c | |||
@@ -285,8 +285,10 @@ void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c) | |||
285 | printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n", | 285 | printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n", |
286 | edx>>24, edx&0xFF, ecx>>24, ecx&0xFF); | 286 | edx>>24, edx&0xFF, ecx>>24, ecx&0xFF); |
287 | c->x86_cache_size = (ecx>>24) + (edx>>24); | 287 | c->x86_cache_size = (ecx>>24) + (edx>>24); |
288 | #ifdef CONFIG_X86_64 | ||
288 | /* On K8 L1 TLB is inclusive, so don't count it */ | 289 | /* On K8 L1 TLB is inclusive, so don't count it */ |
289 | c->x86_tlbsize = 0; | 290 | c->x86_tlbsize = 0; |
291 | #endif | ||
290 | } | 292 | } |
291 | 293 | ||
292 | if (n < 0x80000006) /* Some chips just has a large L1. */ | 294 | if (n < 0x80000006) /* Some chips just has a large L1. */ |
@@ -294,7 +296,22 @@ void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c) | |||
294 | 296 | ||
295 | cpuid(0x80000006, &dummy, &ebx, &ecx, &edx); | 297 | cpuid(0x80000006, &dummy, &ebx, &ecx, &edx); |
296 | l2size = ecx >> 16; | 298 | l2size = ecx >> 16; |
299 | |||
300 | #ifdef CONFIG_X86_64 | ||
297 | c->x86_tlbsize += ((ebx >> 16) & 0xfff) + (ebx & 0xfff); | 301 | c->x86_tlbsize += ((ebx >> 16) & 0xfff) + (ebx & 0xfff); |
302 | #else | ||
303 | |||
304 | /* do processor-specific cache resizing */ | ||
305 | if (this_cpu->c_size_cache) | ||
306 | l2size = this_cpu->c_size_cache(c, l2size); | ||
307 | |||
308 | /* Allow user to override all this if necessary. */ | ||
309 | if (cachesize_override != -1) | ||
310 | l2size = cachesize_override; | ||
311 | |||
312 | if (l2size == 0) | ||
313 | return; /* Again, no L2 cache is possible */ | ||
314 | #endif | ||
298 | 315 | ||
299 | c->x86_cache_size = l2size; | 316 | c->x86_cache_size = l2size; |
300 | 317 | ||