Commit 770d132f authored by Andi Kleen's avatar Andi Kleen Committed by Andi Kleen

[PATCH] i386: Retrieve CLFLUSH size from CPUID

Also report it in /proc/cpuinfo similar to x86-64.

Needed for followon patch
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
parent ea7322de
...@@ -309,6 +309,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 * c) ...@@ -309,6 +309,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 * c)
#else #else
c->apicid = (ebx >> 24) & 0xFF; c->apicid = (ebx >> 24) & 0xFF;
#endif #endif
if (c->x86_capability[0] & (1<<19))
c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
} else { } else {
/* Have CPUID level 0 only - unheard of */ /* Have CPUID level 0 only - unheard of */
c->x86 = 4; c->x86 = 4;
...@@ -373,6 +375,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c) ...@@ -373,6 +375,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
c->x86_vendor_id[0] = '\0'; /* Unset */ c->x86_vendor_id[0] = '\0'; /* Unset */
c->x86_model_id[0] = '\0'; /* Unset */ c->x86_model_id[0] = '\0'; /* Unset */
c->x86_max_cores = 1; c->x86_max_cores = 1;
c->x86_clflush_size = 32;
memset(&c->x86_capability, 0, sizeof c->x86_capability); memset(&c->x86_capability, 0, sizeof c->x86_capability);
if (!have_cpuid_p()) { if (!have_cpuid_p()) {
......
...@@ -152,9 +152,10 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -152,9 +152,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, " [%d]", i); seq_printf(m, " [%d]", i);
} }
seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n", seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
c->loops_per_jiffy/(500000/HZ), c->loops_per_jiffy/(500000/HZ),
(c->loops_per_jiffy/(5000/HZ)) % 100); (c->loops_per_jiffy/(5000/HZ)) % 100);
seq_printf(m, "clflush size\t: %u\n\n", c->x86_clflush_size);
return 0; return 0;
} }
......
...@@ -72,6 +72,7 @@ struct cpuinfo_x86 { ...@@ -72,6 +72,7 @@ struct cpuinfo_x86 {
#endif #endif
unsigned char x86_max_cores; /* cpuid returned max cores value */ unsigned char x86_max_cores; /* cpuid returned max cores value */
unsigned char apicid; unsigned char apicid;
unsigned short x86_clflush_size;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned char booted_cores; /* number of cores as seen by OS */ unsigned char booted_cores; /* number of cores as seen by OS */
__u8 phys_proc_id; /* Physical processor id. */ __u8 phys_proc_id; /* Physical processor id. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment