aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2008-04-30 11:17:46 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-30 17:15:35 -0400
commit5f464707c8c18fccd3c6278ad46ac94b5cf15a98 (patch)
tree6f7c9031a7d5ff01baf9686118e1af7a44f1e894
parent5de8f68b43229cce3d457ca9ac6dab8372a35f18 (diff)
x86: fix HT cpu booting on 32-bit
Since recent smpboot 32/64-bit merge, my dual Xeon with HT has been booting only 2 of its 4 cpus (when running an i386 kernel; but x86_64 is okay). J.A. Magallón reports the same. native_cpu_up: bad cpu 2 native_cpu_up: bad cpu 3 The mach-default cpu_present_to_apicid() was just returning cpu number (2, 3) instead of apicid (6, 7): looks like we now need the x86_64 code even for the i386 case. Comparing with other versions of cpu_present_to_apicid(), it seems a good idea to include an NR_CPUS test too, since cpu_present() doesn't include that; but that wasn't a problem here, and may no problem at all. Prior to that smpboot merge, my Xeon booted the two HT siblings on one physical first, then the two siblings on the other physical after - when i386, but alternated them when x86_64. Since the merge, the x86_64 sequence is unchanged, but the i386 sequence is now like x86_64. I prefer this consistency, and I prefer the new sequence: booting with maxcpus=2 then uses the independent physicals without HT sharing. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/asm-x86/mach-default/mach_apic.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/asm-x86/mach-default/mach_apic.h b/include/asm-x86/mach-default/mach_apic.h
index 0a6634f62abe..21003b56ae95 100644
--- a/include/asm-x86/mach-default/mach_apic.h
+++ b/include/asm-x86/mach-default/mach_apic.h
@@ -109,13 +109,8 @@ static inline int cpu_to_logical_apicid(int cpu)
109 109
110static inline int cpu_present_to_apicid(int mps_cpu) 110static inline int cpu_present_to_apicid(int mps_cpu)
111{ 111{
112#ifdef CONFIG_X86_64 112 if (mps_cpu < NR_CPUS && cpu_present(mps_cpu))
113 if (cpu_present(mps_cpu))
114 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); 113 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
115#else
116 if (mps_cpu < get_physical_broadcast())
117 return mps_cpu;
118#endif
119 else 114 else
120 return BAD_APICID; 115 return BAD_APICID;
121} 116}