diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/apic.h | 20 | ||||
-rw-r--r-- | arch/x86/kernel/apic/Makefile | 17 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_flat_64.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/apic/bigsmp_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/es7000_32.c | 6 | ||||
-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 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_cluster.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_phys.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/vmlinux.lds.S | 7 |
12 files changed, 63 insertions, 6 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index a0c46f061210..80b243c7f0f0 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -381,6 +381,26 @@ struct apic { | |||
381 | extern struct apic *apic; | 381 | extern struct apic *apic; |
382 | 382 | ||
383 | /* | 383 | /* |
384 | * APIC drivers are probed based on how they are listed in the .apicdrivers | ||
385 | * section. So the order is important and enforced by the ordering | ||
386 | * of different apic driver files in the Makefile. | ||
387 | * | ||
388 | * For the files having two apic drivers, we use apic_drivers() | ||
389 | * to enforce the order with in them. | ||
390 | */ | ||
391 | #define apic_driver(sym) \ | ||
392 | static struct apic *__apicdrivers_##sym __used \ | ||
393 | __aligned(sizeof(struct apic *)) \ | ||
394 | __section(.apicdrivers) = { &sym } | ||
395 | |||
396 | #define apic_drivers(sym1, sym2) \ | ||
397 | static struct apic *__apicdrivers_##sym1##sym2[2] __used \ | ||
398 | __aligned(sizeof(struct apic *)) \ | ||
399 | __section(.apicdrivers) = { &sym1, &sym2 } | ||
400 | |||
401 | extern struct apic *__apicdrivers[], *__apicdrivers_end[]; | ||
402 | |||
403 | /* | ||
384 | * APIC functionality to boot other CPUs - only used on SMP: | 404 | * APIC functionality to boot other CPUs - only used on SMP: |
385 | */ | 405 | */ |
386 | #ifdef CONFIG_SMP | 406 | #ifdef CONFIG_SMP |
diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile index 3966b564ea47..767fd04f2843 100644 --- a/arch/x86/kernel/apic/Makefile +++ b/arch/x86/kernel/apic/Makefile | |||
@@ -2,20 +2,25 @@ | |||
2 | # Makefile for local APIC drivers and for the IO-APIC code | 2 | # Makefile for local APIC drivers and for the IO-APIC code |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_X86_LOCAL_APIC) += apic.o apic_noop.o probe_$(BITS).o ipi.o | 5 | obj-$(CONFIG_X86_LOCAL_APIC) += apic.o apic_noop.o ipi.o |
6 | obj-y += hw_nmi.o | 6 | obj-y += hw_nmi.o |
7 | 7 | ||
8 | obj-$(CONFIG_X86_IO_APIC) += io_apic.o | 8 | obj-$(CONFIG_X86_IO_APIC) += io_apic.o |
9 | obj-$(CONFIG_SMP) += ipi.o | 9 | obj-$(CONFIG_SMP) += ipi.o |
10 | 10 | ||
11 | ifeq ($(CONFIG_X86_64),y) | 11 | ifeq ($(CONFIG_X86_64),y) |
12 | obj-y += apic_flat_64.o | 12 | # APIC probe will depend on the listing order here |
13 | obj-$(CONFIG_X86_X2APIC) += x2apic_cluster.o | ||
14 | obj-$(CONFIG_X86_X2APIC) += x2apic_phys.o | ||
15 | obj-$(CONFIG_X86_UV) += x2apic_uv_x.o | 13 | obj-$(CONFIG_X86_UV) += x2apic_uv_x.o |
14 | obj-$(CONFIG_X86_X2APIC) += x2apic_phys.o | ||
15 | obj-$(CONFIG_X86_X2APIC) += x2apic_cluster.o | ||
16 | obj-y += apic_flat_64.o | ||
16 | endif | 17 | endif |
17 | 18 | ||
18 | obj-$(CONFIG_X86_BIGSMP) += bigsmp_32.o | 19 | # APIC probe will depend on the listing order here |
19 | obj-$(CONFIG_X86_NUMAQ) += numaq_32.o | 20 | obj-$(CONFIG_X86_NUMAQ) += numaq_32.o |
20 | obj-$(CONFIG_X86_ES7000) += es7000_32.o | ||
21 | obj-$(CONFIG_X86_SUMMIT) += summit_32.o | 21 | obj-$(CONFIG_X86_SUMMIT) += summit_32.o |
22 | obj-$(CONFIG_X86_BIGSMP) += bigsmp_32.o | ||
23 | obj-$(CONFIG_X86_ES7000) += es7000_32.o | ||
24 | |||
25 | # For 32bit, probe_32 need to be listed last | ||
26 | obj-$(CONFIG_X86_LOCAL_APIC) += probe_$(BITS).o | ||
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index 025921f03eb3..6ce0f7f08c57 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
@@ -377,3 +377,8 @@ struct apic apic_physflat = { | |||
377 | .wait_icr_idle = native_apic_wait_icr_idle, | 377 | .wait_icr_idle = native_apic_wait_icr_idle, |
378 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 378 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
379 | }; | 379 | }; |
380 | |||
381 | /* | ||
382 | * We need to check for physflat first, so this order is important. | ||
383 | */ | ||
384 | apic_drivers(apic_physflat, apic_flat); | ||
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index d84ac5a584b5..cfb13c3e5451 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
@@ -254,3 +254,5 @@ struct apic apic_bigsmp = { | |||
254 | 254 | ||
255 | .x86_32_early_logical_apicid = bigsmp_early_logical_apicid, | 255 | .x86_32_early_logical_apicid = bigsmp_early_logical_apicid, |
256 | }; | 256 | }; |
257 | |||
258 | apic_driver(apic_bigsmp); | ||
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index 70533de5bd29..80de0d78cbca 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c | |||
@@ -747,3 +747,9 @@ struct apic __refdata apic_es7000 = { | |||
747 | 747 | ||
748 | .x86_32_early_logical_apicid = es7000_early_logical_apicid, | 748 | .x86_32_early_logical_apicid = es7000_early_logical_apicid, |
749 | }; | 749 | }; |
750 | |||
751 | /* | ||
752 | * Need to check for es7000 followed by es7000_cluster, so this order | ||
753 | * in apic_drivers is important. | ||
754 | */ | ||
755 | apic_drivers(apic_es7000, apic_es7000_cluster); | ||
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index 30f13319e24b..4caab0d13d99 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -537,3 +537,5 @@ struct apic __refdata apic_numaq = { | |||
537 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | 537 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, |
538 | .x86_32_numa_cpu_node = numaq_numa_cpu_node, | 538 | .x86_32_numa_cpu_node = numaq_numa_cpu_node, |
539 | }; | 539 | }; |
540 | |||
541 | apic_driver(apic_numaq); | ||
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 6541e471fd91..a319b33cfc14 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
@@ -174,6 +174,8 @@ struct apic apic_default = { | |||
174 | .x86_32_early_logical_apicid = default_x86_32_early_logical_apicid, | 174 | .x86_32_early_logical_apicid = default_x86_32_early_logical_apicid, |
175 | }; | 175 | }; |
176 | 176 | ||
177 | apic_driver(apic_default); | ||
178 | |||
177 | extern struct apic apic_numaq; | 179 | extern struct apic apic_numaq; |
178 | extern struct apic apic_summit; | 180 | extern struct apic apic_summit; |
179 | extern struct apic apic_bigsmp; | 181 | extern struct apic apic_bigsmp; |
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c index 35bcd7d995a1..447ec0fa9aa1 100644 --- a/arch/x86/kernel/apic/summit_32.c +++ b/arch/x86/kernel/apic/summit_32.c | |||
@@ -552,3 +552,5 @@ struct apic apic_summit = { | |||
552 | 552 | ||
553 | .x86_32_early_logical_apicid = summit_early_logical_apicid, | 553 | .x86_32_early_logical_apicid = summit_early_logical_apicid, |
554 | }; | 554 | }; |
555 | |||
556 | apic_driver(apic_summit); | ||
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index f7875d9a18c2..7595c5775a54 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
@@ -264,3 +264,5 @@ struct apic apic_x2apic_cluster = { | |||
264 | .wait_icr_idle = native_x2apic_wait_icr_idle, | 264 | .wait_icr_idle = native_x2apic_wait_icr_idle, |
265 | .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle, | 265 | .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle, |
266 | }; | 266 | }; |
267 | |||
268 | apic_driver(apic_x2apic_cluster); | ||
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index 78c8f33a09fa..f7ba21cb3e25 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c | |||
@@ -168,3 +168,5 @@ struct apic apic_x2apic_phys = { | |||
168 | .wait_icr_idle = native_x2apic_wait_icr_idle, | 168 | .wait_icr_idle = native_x2apic_wait_icr_idle, |
169 | .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle, | 169 | .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle, |
170 | }; | 170 | }; |
171 | |||
172 | apic_driver(apic_x2apic_phys); | ||
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 6bb80b1c8a7a..b6c629838f00 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -864,3 +864,5 @@ void __init uv_system_init(void) | |||
864 | if (is_kdump_kernel()) | 864 | if (is_kdump_kernel()) |
865 | reboot_type = BOOT_ACPI; | 865 | reboot_type = BOOT_ACPI; |
866 | } | 866 | } |
867 | |||
868 | apic_driver(apic_x2apic_uv_x); | ||
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 624a2016198e..49927a863cc1 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S | |||
@@ -306,6 +306,13 @@ SECTIONS | |||
306 | } | 306 | } |
307 | 307 | ||
308 | . = ALIGN(8); | 308 | . = ALIGN(8); |
309 | .apicdrivers : AT(ADDR(.apicdrivers) - LOAD_OFFSET) { | ||
310 | __apicdrivers = .; | ||
311 | *(.apicdrivers); | ||
312 | __apicdrivers_end = .; | ||
313 | } | ||
314 | |||
315 | . = ALIGN(8); | ||
309 | /* | 316 | /* |
310 | * .exit.text is discard at runtime, not link time, to deal with | 317 | * .exit.text is discard at runtime, not link time, to deal with |
311 | * references from .altinstructions and .eh_frame | 318 | * references from .altinstructions and .eh_frame |