Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112819
b: refs/heads/master
c: 140fc72
h: refs/heads/master
i:
  112817: cba330b
  112815: cbed35e
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Sep 5, 2008
1 parent 58619dd commit 97b7484
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9e67f00424e164dcd29391eb48dc941db8691ad
refs/heads/master: 140fc72709278989f08eb756d16a70008bdcc409
8 changes: 8 additions & 0 deletions trunk/arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n",
edx>>24, edx&0xFF, ecx>>24, ecx&0xFF);
c->x86_cache_size = (ecx>>24) + (edx>>24);
#ifdef CONFIG_X86_64
/* On K8 L1 TLB is inclusive, so don't count it */
c->x86_tlbsize = 0;
#endif
}

if (n < 0x80000006) /* Some chips just has a large L1. */
Expand All @@ -293,6 +297,9 @@ void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
cpuid(0x80000006, &dummy, &ebx, &ecx, &edx);
l2size = ecx >> 16;

#ifdef CONFIG_X86_64
c->x86_tlbsize += ((ebx >> 16) & 0xfff) + (ebx & 0xfff);
#else
/* do processor-specific cache resizing */
if (this_cpu->c_size_cache)
l2size = this_cpu->c_size_cache(c, l2size);
Expand All @@ -303,6 +310,7 @@ void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)

if (l2size == 0)
return; /* Again, no L2 cache is possible */
#endif

c->x86_cache_size = l2size;

Expand Down
17 changes: 17 additions & 0 deletions trunk/arch/x86/kernel/cpu/common_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,33 @@ void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n",
edx>>24, edx&0xFF, ecx>>24, ecx&0xFF);
c->x86_cache_size = (ecx>>24) + (edx>>24);
#ifdef CONFIG_X86_64
/* On K8 L1 TLB is inclusive, so don't count it */
c->x86_tlbsize = 0;
#endif
}

if (n < 0x80000006) /* Some chips just has a large L1. */
return;

cpuid(0x80000006, &dummy, &ebx, &ecx, &edx);
l2size = ecx >> 16;

#ifdef CONFIG_X86_64
c->x86_tlbsize += ((ebx >> 16) & 0xfff) + (ebx & 0xfff);
#else

/* do processor-specific cache resizing */
if (this_cpu->c_size_cache)
l2size = this_cpu->c_size_cache(c, l2size);

/* Allow user to override all this if necessary. */
if (cachesize_override != -1)
l2size = cachesize_override;

if (l2size == 0)
return; /* Again, no L2 cache is possible */
#endif

c->x86_cache_size = l2size;

Expand Down

0 comments on commit 97b7484

Please sign in to comment.