Commit 42382d56 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] i386: Count both multi cores and SMP siblings in /proc/cpuinfo siblings.

Count both multi cores and SMP siblings in /proc/cpuinfo siblings.

This avoids breaking user space licensing managers who license by CPU on dual
core systems.

Port of the equivalent code on x86-64.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b9662b21
...@@ -437,6 +437,7 @@ void __init dodgy_tsc(void) ...@@ -437,6 +437,7 @@ void __init dodgy_tsc(void)
cpu_devs[X86_VENDOR_CYRIX]->c_init(&boot_cpu_data); cpu_devs[X86_VENDOR_CYRIX]->c_init(&boot_cpu_data);
} }
#ifdef CONFIG_X86_HT
void __init detect_ht(struct cpuinfo_x86 *c) void __init detect_ht(struct cpuinfo_x86 *c)
{ {
u32 eax, ebx, ecx, edx; u32 eax, ebx, ecx, edx;
...@@ -478,6 +479,7 @@ void __init detect_ht(struct cpuinfo_x86 *c) ...@@ -478,6 +479,7 @@ void __init detect_ht(struct cpuinfo_x86 *c)
phys_proc_id[cpu]); phys_proc_id[cpu]);
} }
} }
#endif
void __init print_cpu_info(struct cpuinfo_x86 *c) void __init print_cpu_info(struct cpuinfo_x86 *c)
{ {
......
...@@ -139,9 +139,7 @@ static void __init init_intel(struct cpuinfo_x86 *c) ...@@ -139,9 +139,7 @@ static void __init init_intel(struct cpuinfo_x86 *c)
if ( p ) if ( p )
strcpy(c->x86_model_id, p); strcpy(c->x86_model_id, p);
#ifdef CONFIG_X86_HT
detect_ht(c); detect_ht(c);
#endif
/* Work around errata */ /* Work around errata */
Intel_errata_workarounds(c); Intel_errata_workarounds(c);
......
...@@ -94,11 +94,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -94,11 +94,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
if (c->x86_cache_size >= 0) if (c->x86_cache_size >= 0)
seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
#ifdef CONFIG_X86_HT #ifdef CONFIG_X86_HT
if (smp_num_siblings > 1) { seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]);
extern int phys_proc_id[NR_CPUS]; seq_printf(m, "siblings\t: %d\n", c->x86_num_cores * smp_num_siblings);
seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]);
seq_printf(m, "siblings\t: %d\n", smp_num_siblings);
}
#endif #endif
/* We use exception 16 if we have hardware math and we've either seen it or the CPU claims it is internal */ /* We use exception 16 if we have hardware math and we've either seen it or the CPU claims it is internal */
......
...@@ -104,7 +104,12 @@ extern void identify_cpu(struct cpuinfo_x86 *); ...@@ -104,7 +104,12 @@ extern void identify_cpu(struct cpuinfo_x86 *);
extern void print_cpu_info(struct cpuinfo_x86 *); extern void print_cpu_info(struct cpuinfo_x86 *);
extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
extern void dodgy_tsc(void); extern void dodgy_tsc(void);
#ifdef CONFIG_X86_HT
extern void detect_ht(struct cpuinfo_x86 *c); extern void detect_ht(struct cpuinfo_x86 *c);
#else
static inline void detect_ht(struct cpuinfo_x86 *c) {}
#endif
/* /*
* EFLAGS bits * EFLAGS bits
......
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