diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-23 08:37:33 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-28 08:54:06 -0500 |
commit | acb8bc09c6185e4d3d582d0076aaa6a89f19d8c5 (patch) | |
tree | 72dbecce548a362c665a0c4c9fab428aaa854ecc /arch/x86/kernel/apic | |
parent | 7632611f534340182c832d2b139cb19676f24e1a (diff) |
x86: Add apic->x86_32_early_logical_apicid()
On x86_32, the mapping between cpu and logical apic ID differs
depending on the specific apic implementation in use. The
mapping is initialized while bringing up CPUs; however, this
makes early inits ignore memory topology.
Add a x86_32 specific apic->x86_32_early_logical_apicid() which
is called early during boot to query the mapping. The mapping
is later verified against the result of init_apic_ldr(). The
method is allowed to return BAD_APICID if it can't be determined
early.
noop variant which always returns BAD_APICID is implemented and
added to all x86_32 apic implementations.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: eric.dumazet@gmail.com
Cc: yinghai@kernel.org
Cc: brgerst@gmail.com
Cc: gorcunov@gmail.com
Cc: penberg@kernel.org
Cc: shaohui.zheng@intel.com
Cc: rientjes@google.com
LKML-Reference: <1295789862-25482-8-git-send-email-tj@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 12 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_noop.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic/bigsmp_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/es7000_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/probe_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/summit_32.c | 2 |
7 files changed, 26 insertions, 2 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index ae08246f320c..3127079628e8 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -1250,8 +1250,13 @@ void __cpuinit setup_local_APIC(void) | |||
1250 | 1250 | ||
1251 | #ifdef CONFIG_X86_32 | 1251 | #ifdef CONFIG_X86_32 |
1252 | /* | 1252 | /* |
1253 | * APIC LDR is initialized. Fetch and store logical_apic_id. | 1253 | * APIC LDR is initialized. If logical_apicid mapping was |
1254 | * initialized during get_smp_config(), make sure it matches the | ||
1255 | * actual value. | ||
1254 | */ | 1256 | */ |
1257 | i = early_per_cpu(x86_cpu_to_logical_apicid, cpu); | ||
1258 | WARN_ON(i != BAD_APICID && i != logical_smp_processor_id()); | ||
1259 | /* always use the value from LDR */ | ||
1255 | early_per_cpu(x86_cpu_to_logical_apicid, cpu) = | 1260 | early_per_cpu(x86_cpu_to_logical_apicid, cpu) = |
1256 | logical_smp_processor_id(); | 1261 | logical_smp_processor_id(); |
1257 | #endif | 1262 | #endif |
@@ -1991,7 +1996,10 @@ void __cpuinit generic_processor_info(int apicid, int version) | |||
1991 | early_per_cpu(x86_cpu_to_apicid, cpu) = apicid; | 1996 | early_per_cpu(x86_cpu_to_apicid, cpu) = apicid; |
1992 | early_per_cpu(x86_bios_cpu_apicid, cpu) = apicid; | 1997 | early_per_cpu(x86_bios_cpu_apicid, cpu) = apicid; |
1993 | #endif | 1998 | #endif |
1994 | 1999 | #ifdef CONFIG_X86_32 | |
2000 | early_per_cpu(x86_cpu_to_logical_apicid, cpu) = | ||
2001 | apic->x86_32_early_logical_apicid(cpu); | ||
2002 | #endif | ||
1995 | set_cpu_possible(cpu, true); | 2003 | set_cpu_possible(cpu, true); |
1996 | set_cpu_present(cpu, true); | 2004 | set_cpu_present(cpu, true); |
1997 | } | 2005 | } |
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c index f3d19b2426ab..0309c58d96bc 100644 --- a/arch/x86/kernel/apic/apic_noop.c +++ b/arch/x86/kernel/apic/apic_noop.c | |||
@@ -191,4 +191,8 @@ struct apic apic_noop = { | |||
191 | .icr_write = noop_apic_icr_write, | 191 | .icr_write = noop_apic_icr_write, |
192 | .wait_icr_idle = noop_apic_wait_icr_idle, | 192 | .wait_icr_idle = noop_apic_wait_icr_idle, |
193 | .safe_wait_icr_idle = noop_safe_apic_wait_icr_idle, | 193 | .safe_wait_icr_idle = noop_safe_apic_wait_icr_idle, |
194 | |||
195 | #ifdef CONFIG_X86_32 | ||
196 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | ||
197 | #endif | ||
194 | }; | 198 | }; |
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index 4c62592d6869..dd32a9b78a87 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
@@ -251,4 +251,6 @@ struct apic apic_bigsmp = { | |||
251 | .icr_write = native_apic_icr_write, | 251 | .icr_write = native_apic_icr_write, |
252 | .wait_icr_idle = native_apic_wait_icr_idle, | 252 | .wait_icr_idle = native_apic_wait_icr_idle, |
253 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 253 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
254 | |||
255 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | ||
254 | }; | 256 | }; |
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index 6840681a3f14..0ffc1eca5777 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c | |||
@@ -682,6 +682,8 @@ struct apic __refdata apic_es7000_cluster = { | |||
682 | .icr_write = native_apic_icr_write, | 682 | .icr_write = native_apic_icr_write, |
683 | .wait_icr_idle = native_apic_wait_icr_idle, | 683 | .wait_icr_idle = native_apic_wait_icr_idle, |
684 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 684 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
685 | |||
686 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | ||
685 | }; | 687 | }; |
686 | 688 | ||
687 | struct apic __refdata apic_es7000 = { | 689 | struct apic __refdata apic_es7000 = { |
@@ -744,4 +746,6 @@ struct apic __refdata apic_es7000 = { | |||
744 | .icr_write = native_apic_icr_write, | 746 | .icr_write = native_apic_icr_write, |
745 | .wait_icr_idle = native_apic_wait_icr_idle, | 747 | .wait_icr_idle = native_apic_wait_icr_idle, |
746 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 748 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
749 | |||
750 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | ||
747 | }; | 751 | }; |
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index 2b434d579e15..f1a8b120c49d 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -539,4 +539,6 @@ struct apic __refdata apic_numaq = { | |||
539 | .icr_write = native_apic_icr_write, | 539 | .icr_write = native_apic_icr_write, |
540 | .wait_icr_idle = native_apic_wait_icr_idle, | 540 | .wait_icr_idle = native_apic_wait_icr_idle, |
541 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 541 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
542 | |||
543 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | ||
542 | }; | 544 | }; |
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 24a68281101b..40be7c3cdfeb 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
@@ -166,6 +166,8 @@ struct apic apic_default = { | |||
166 | .icr_write = native_apic_icr_write, | 166 | .icr_write = native_apic_icr_write, |
167 | .wait_icr_idle = native_apic_wait_icr_idle, | 167 | .wait_icr_idle = native_apic_wait_icr_idle, |
168 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 168 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
169 | |||
170 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | ||
169 | }; | 171 | }; |
170 | 172 | ||
171 | extern struct apic apic_numaq; | 173 | extern struct apic apic_numaq; |
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c index 1ef4c14f4d6b..172c498e888f 100644 --- a/arch/x86/kernel/apic/summit_32.c +++ b/arch/x86/kernel/apic/summit_32.c | |||
@@ -552,4 +552,6 @@ struct apic apic_summit = { | |||
552 | .icr_write = native_apic_icr_write, | 552 | .icr_write = native_apic_icr_write, |
553 | .wait_icr_idle = native_apic_wait_icr_idle, | 553 | .wait_icr_idle = native_apic_wait_icr_idle, |
554 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 554 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
555 | |||
556 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | ||
555 | }; | 557 | }; |