diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-02-25 23:50:49 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-26 00:32:25 -0500 |
commit | 2b6163bf5772644068694583816fa41e8474239f (patch) | |
tree | b854e9070254ad2942901941b67e8a56d61f7f91 /arch/x86 | |
parent | ecc25fbd6b9e07b33895c61ddf84006b00f55d99 (diff) |
x86: remove update_apic from x86_quirks
Impact: cleanup
x86_quirks->update_apic() calling looks crazy. so try to remove it:
1. every apic take wakeup_cpu member directly
2. separate es7000_apic to es7000_apic_cluster
3. use uv_wakeup_cpu directly
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/apic.h | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/setup.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/uv/uv.h | 3 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_flat_64.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic/bigsmp_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/es7000_32.c | 127 | ||||
-rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/apic/probe_32.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/apic/probe_64.c | 3 | ||||
-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 | 11 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 14 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 8 |
15 files changed, 121 insertions, 93 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index a6208dc74633..860504178e94 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -325,6 +325,9 @@ struct apic { | |||
325 | }; | 325 | }; |
326 | 326 | ||
327 | extern struct apic *apic; | 327 | extern struct apic *apic; |
328 | extern atomic_t init_deasserted; | ||
329 | extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip); | ||
330 | extern int wakeup_secondary_cpu_via_init(int apicid, unsigned long start_eip); | ||
328 | 331 | ||
329 | static inline u32 apic_read(u32 reg) | 332 | static inline u32 apic_read(u32 reg) |
330 | { | 333 | { |
@@ -384,9 +387,7 @@ static inline unsigned default_get_apic_id(unsigned long x) | |||
384 | #define DEFAULT_TRAMPOLINE_PHYS_LOW 0x467 | 387 | #define DEFAULT_TRAMPOLINE_PHYS_LOW 0x467 |
385 | #define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469 | 388 | #define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469 |
386 | 389 | ||
387 | #ifdef CONFIG_X86_32 | 390 | #ifdef CONFIG_X86_64 |
388 | extern void es7000_update_apic_to_cluster(void); | ||
389 | #else | ||
390 | extern struct apic apic_flat; | 391 | extern struct apic apic_flat; |
391 | extern struct apic apic_physflat; | 392 | extern struct apic apic_physflat; |
392 | extern struct apic apic_x2apic_cluster; | 393 | extern struct apic apic_x2apic_cluster; |
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index 66801cb72f69..126877e502e4 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h | |||
@@ -31,7 +31,6 @@ struct x86_quirks { | |||
31 | void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable, | 31 | void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable, |
32 | unsigned short oemsize); | 32 | unsigned short oemsize); |
33 | int (*setup_ioapic_ids)(void); | 33 | int (*setup_ioapic_ids)(void); |
34 | int (*update_apic)(void); | ||
35 | }; | 34 | }; |
36 | 35 | ||
37 | extern void x86_quirk_pre_intr_init(void); | 36 | extern void x86_quirk_pre_intr_init(void); |
@@ -77,8 +76,6 @@ static inline void visws_early_detect(void) { } | |||
77 | static inline int is_visws_box(void) { return 0; } | 76 | static inline int is_visws_box(void) { return 0; } |
78 | #endif | 77 | #endif |
79 | 78 | ||
80 | extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip); | ||
81 | extern int wakeup_secondary_cpu_via_init(int apicid, unsigned long start_eip); | ||
82 | extern struct x86_quirks *x86_quirks; | 79 | extern struct x86_quirks *x86_quirks; |
83 | extern unsigned long saved_video_mode; | 80 | extern unsigned long saved_video_mode; |
84 | 81 | ||
diff --git a/arch/x86/include/asm/uv/uv.h b/arch/x86/include/asm/uv/uv.h index 8242bf965812..c0a01b5d985b 100644 --- a/arch/x86/include/asm/uv/uv.h +++ b/arch/x86/include/asm/uv/uv.h | |||
@@ -12,7 +12,6 @@ extern enum uv_system_type get_uv_system_type(void); | |||
12 | extern int is_uv_system(void); | 12 | extern int is_uv_system(void); |
13 | extern void uv_cpu_init(void); | 13 | extern void uv_cpu_init(void); |
14 | extern void uv_system_init(void); | 14 | extern void uv_system_init(void); |
15 | extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); | ||
16 | extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, | 15 | extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, |
17 | struct mm_struct *mm, | 16 | struct mm_struct *mm, |
18 | unsigned long va, | 17 | unsigned long va, |
@@ -24,8 +23,6 @@ static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; } | |||
24 | static inline int is_uv_system(void) { return 0; } | 23 | static inline int is_uv_system(void) { return 0; } |
25 | static inline void uv_cpu_init(void) { } | 24 | static inline void uv_cpu_init(void) { } |
26 | static inline void uv_system_init(void) { } | 25 | static inline void uv_system_init(void) { } |
27 | static inline int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip) | ||
28 | { return 1; } | ||
29 | static inline const struct cpumask * | 26 | static inline const struct cpumask * |
30 | uv_flush_tlb_others(const struct cpumask *cpumask, struct mm_struct *mm, | 27 | uv_flush_tlb_others(const struct cpumask *cpumask, struct mm_struct *mm, |
31 | unsigned long va, unsigned int cpu) | 28 | unsigned long va, unsigned int cpu) |
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index 3b002995e145..00595bc2da8d 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
@@ -222,7 +222,7 @@ struct apic apic_flat = { | |||
222 | .send_IPI_all = flat_send_IPI_all, | 222 | .send_IPI_all = flat_send_IPI_all, |
223 | .send_IPI_self = apic_send_IPI_self, | 223 | .send_IPI_self = apic_send_IPI_self, |
224 | 224 | ||
225 | .wakeup_cpu = NULL, | 225 | .wakeup_cpu = wakeup_secondary_cpu_via_init, |
226 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 226 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
227 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 227 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
228 | .wait_for_init_deassert = NULL, | 228 | .wait_for_init_deassert = NULL, |
@@ -373,7 +373,7 @@ struct apic apic_physflat = { | |||
373 | .send_IPI_all = physflat_send_IPI_all, | 373 | .send_IPI_all = physflat_send_IPI_all, |
374 | .send_IPI_self = apic_send_IPI_self, | 374 | .send_IPI_self = apic_send_IPI_self, |
375 | 375 | ||
376 | .wakeup_cpu = NULL, | 376 | .wakeup_cpu = wakeup_secondary_cpu_via_init, |
377 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 377 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
378 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 378 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
379 | .wait_for_init_deassert = NULL, | 379 | .wait_for_init_deassert = NULL, |
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index 0b1093394fdf..8c25917b51a0 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
@@ -256,7 +256,7 @@ struct apic apic_bigsmp = { | |||
256 | .send_IPI_all = bigsmp_send_IPI_all, | 256 | .send_IPI_all = bigsmp_send_IPI_all, |
257 | .send_IPI_self = default_send_IPI_self, | 257 | .send_IPI_self = default_send_IPI_self, |
258 | 258 | ||
259 | .wakeup_cpu = NULL, | 259 | .wakeup_cpu = wakeup_secondary_cpu_via_init, |
260 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 260 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
261 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 261 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
262 | 262 | ||
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index 320f2d2e4e54..9f6102fc87a1 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c | |||
@@ -163,17 +163,12 @@ static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip) | |||
163 | return 0; | 163 | return 0; |
164 | } | 164 | } |
165 | 165 | ||
166 | static int __init es7000_update_apic(void) | 166 | static int __init es7000_apic_is_cluster(void) |
167 | { | 167 | { |
168 | apic->wakeup_cpu = wakeup_secondary_cpu_via_mip; | ||
169 | |||
170 | /* MPENTIUMIII */ | 168 | /* MPENTIUMIII */ |
171 | if (boot_cpu_data.x86 == 6 && | 169 | if (boot_cpu_data.x86 == 6 && |
172 | (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) { | 170 | (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) |
173 | es7000_update_apic_to_cluster(); | 171 | return 1; |
174 | apic->wait_for_init_deassert = NULL; | ||
175 | apic->wakeup_cpu = wakeup_secondary_cpu_via_mip; | ||
176 | } | ||
177 | 172 | ||
178 | return 0; | 173 | return 0; |
179 | } | 174 | } |
@@ -192,8 +187,6 @@ static void __init setup_unisys(void) | |||
192 | else | 187 | else |
193 | es7000_plat = ES7000_CLASSIC; | 188 | es7000_plat = ES7000_CLASSIC; |
194 | ioapic_renumber_irq = es7000_rename_gsi; | 189 | ioapic_renumber_irq = es7000_rename_gsi; |
195 | |||
196 | x86_quirks->update_apic = es7000_update_apic; | ||
197 | } | 190 | } |
198 | 191 | ||
199 | /* | 192 | /* |
@@ -310,6 +303,8 @@ static int es7000_check_dsdt(void) | |||
310 | return 0; | 303 | return 0; |
311 | } | 304 | } |
312 | 305 | ||
306 | static int __initdata es7000_acpi_ret; | ||
307 | |||
313 | /* Hook from generic ACPI tables.c */ | 308 | /* Hook from generic ACPI tables.c */ |
314 | static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 309 | static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
315 | { | 310 | { |
@@ -332,8 +327,19 @@ static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
332 | */ | 327 | */ |
333 | unmap_unisys_acpi_oem_table(oem_addr); | 328 | unmap_unisys_acpi_oem_table(oem_addr); |
334 | } | 329 | } |
335 | return ret; | 330 | |
331 | es7000_acpi_ret = ret; | ||
332 | |||
333 | return ret && !es7000_apic_is_cluster(); | ||
336 | } | 334 | } |
335 | static int __init es7000_acpi_madt_oem_check_cluster(char *oem_id, | ||
336 | char *oem_table_id) | ||
337 | { | ||
338 | int ret = es7000_acpi_ret; | ||
339 | |||
340 | return ret && es7000_apic_is_cluster(); | ||
341 | } | ||
342 | |||
337 | #else /* !CONFIG_ACPI: */ | 343 | #else /* !CONFIG_ACPI: */ |
338 | static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 344 | static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
339 | { | 345 | { |
@@ -416,11 +422,8 @@ static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask) | |||
416 | 422 | ||
417 | static void es7000_wait_for_init_deassert(atomic_t *deassert) | 423 | static void es7000_wait_for_init_deassert(atomic_t *deassert) |
418 | { | 424 | { |
419 | #ifndef CONFIG_ES7000_CLUSTERED_APIC | ||
420 | while (!atomic_read(deassert)) | 425 | while (!atomic_read(deassert)) |
421 | cpu_relax(); | 426 | cpu_relax(); |
422 | #endif | ||
423 | return; | ||
424 | } | 427 | } |
425 | 428 | ||
426 | static unsigned int es7000_get_apic_id(unsigned long x) | 429 | static unsigned int es7000_get_apic_id(unsigned long x) |
@@ -659,37 +662,103 @@ static int es7000_phys_pkg_id(int cpuid_apic, int index_msb) | |||
659 | return cpuid_apic >> index_msb; | 662 | return cpuid_apic >> index_msb; |
660 | } | 663 | } |
661 | 664 | ||
662 | void __init es7000_update_apic_to_cluster(void) | ||
663 | { | ||
664 | apic->target_cpus = target_cpus_cluster; | ||
665 | apic->irq_delivery_mode = dest_LowestPrio; | ||
666 | /* logical delivery broadcast to all procs: */ | ||
667 | apic->irq_dest_mode = 1; | ||
668 | |||
669 | apic->init_apic_ldr = es7000_init_apic_ldr_cluster; | ||
670 | |||
671 | apic->cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster; | ||
672 | } | ||
673 | |||
674 | static int probe_es7000(void) | 665 | static int probe_es7000(void) |
675 | { | 666 | { |
676 | /* probed later in mptable/ACPI hooks */ | 667 | /* probed later in mptable/ACPI hooks */ |
677 | return 0; | 668 | return 0; |
678 | } | 669 | } |
679 | 670 | ||
671 | static int __initdata es7000_mps_ret; | ||
680 | static __init int | 672 | static __init int |
681 | es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | 673 | es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) |
682 | { | 674 | { |
675 | int ret = 0; | ||
676 | |||
683 | if (mpc->oemptr) { | 677 | if (mpc->oemptr) { |
684 | struct mpc_oemtable *oem_table = | 678 | struct mpc_oemtable *oem_table = |
685 | (struct mpc_oemtable *)mpc->oemptr; | 679 | (struct mpc_oemtable *)mpc->oemptr; |
686 | 680 | ||
687 | if (!strncmp(oem, "UNISYS", 6)) | 681 | if (!strncmp(oem, "UNISYS", 6)) |
688 | return parse_unisys_oem((char *)oem_table); | 682 | ret = parse_unisys_oem((char *)oem_table); |
689 | } | 683 | } |
690 | return 0; | 684 | |
685 | es7000_mps_ret = ret; | ||
686 | |||
687 | return ret && !es7000_apic_is_cluster(); | ||
688 | } | ||
689 | |||
690 | static __init int | ||
691 | es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem, char *productid) | ||
692 | { | ||
693 | int ret = es7000_mps_ret; | ||
694 | |||
695 | return ret && es7000_apic_is_cluster(); | ||
691 | } | 696 | } |
692 | 697 | ||
698 | struct apic apic_es7000_cluster = { | ||
699 | |||
700 | .name = "es7000", | ||
701 | .probe = probe_es7000, | ||
702 | .acpi_madt_oem_check = es7000_acpi_madt_oem_check_cluster, | ||
703 | .apic_id_registered = es7000_apic_id_registered, | ||
704 | |||
705 | .irq_delivery_mode = dest_LowestPrio, | ||
706 | /* logical delivery broadcast to all procs: */ | ||
707 | .irq_dest_mode = 1, | ||
708 | |||
709 | .target_cpus = target_cpus_cluster, | ||
710 | .disable_esr = 1, | ||
711 | .dest_logical = 0, | ||
712 | .check_apicid_used = es7000_check_apicid_used, | ||
713 | .check_apicid_present = es7000_check_apicid_present, | ||
714 | |||
715 | .vector_allocation_domain = es7000_vector_allocation_domain, | ||
716 | .init_apic_ldr = es7000_init_apic_ldr_cluster, | ||
717 | |||
718 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, | ||
719 | .setup_apic_routing = es7000_setup_apic_routing, | ||
720 | .multi_timer_check = NULL, | ||
721 | .apicid_to_node = es7000_apicid_to_node, | ||
722 | .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, | ||
723 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, | ||
724 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, | ||
725 | .setup_portio_remap = NULL, | ||
726 | .check_phys_apicid_present = es7000_check_phys_apicid_present, | ||
727 | .enable_apic_mode = es7000_enable_apic_mode, | ||
728 | .phys_pkg_id = es7000_phys_pkg_id, | ||
729 | .mps_oem_check = es7000_mps_oem_check_cluster, | ||
730 | |||
731 | .get_apic_id = es7000_get_apic_id, | ||
732 | .set_apic_id = NULL, | ||
733 | .apic_id_mask = 0xFF << 24, | ||
734 | |||
735 | .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster, | ||
736 | .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and, | ||
737 | |||
738 | .send_IPI_mask = es7000_send_IPI_mask, | ||
739 | .send_IPI_mask_allbutself = NULL, | ||
740 | .send_IPI_allbutself = es7000_send_IPI_allbutself, | ||
741 | .send_IPI_all = es7000_send_IPI_all, | ||
742 | .send_IPI_self = default_send_IPI_self, | ||
743 | |||
744 | .wakeup_cpu = wakeup_secondary_cpu_via_mip, | ||
745 | |||
746 | .trampoline_phys_low = 0x467, | ||
747 | .trampoline_phys_high = 0x469, | ||
748 | |||
749 | .wait_for_init_deassert = NULL, | ||
750 | |||
751 | /* Nothing to do for most platforms, since cleared by the INIT cycle: */ | ||
752 | .smp_callin_clear_local_apic = NULL, | ||
753 | .inquire_remote_apic = default_inquire_remote_apic, | ||
754 | |||
755 | .read = native_apic_mem_read, | ||
756 | .write = native_apic_mem_write, | ||
757 | .icr_read = native_apic_icr_read, | ||
758 | .icr_write = native_apic_icr_write, | ||
759 | .wait_icr_idle = native_apic_wait_icr_idle, | ||
760 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | ||
761 | }; | ||
693 | 762 | ||
694 | struct apic apic_es7000 = { | 763 | struct apic apic_es7000 = { |
695 | 764 | ||
@@ -737,7 +806,7 @@ struct apic apic_es7000 = { | |||
737 | .send_IPI_all = es7000_send_IPI_all, | 806 | .send_IPI_all = es7000_send_IPI_all, |
738 | .send_IPI_self = default_send_IPI_self, | 807 | .send_IPI_self = default_send_IPI_self, |
739 | 808 | ||
740 | .wakeup_cpu = NULL, | 809 | .wakeup_cpu = wakeup_secondary_cpu_via_init, |
741 | 810 | ||
742 | .trampoline_phys_low = 0x467, | 811 | .trampoline_phys_low = 0x467, |
743 | .trampoline_phys_high = 0x469, | 812 | .trampoline_phys_high = 0x469, |
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index d9d6d61eed82..c503c1799d63 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -256,13 +256,6 @@ static int __init numaq_setup_ioapic_ids(void) | |||
256 | return 1; | 256 | return 1; |
257 | } | 257 | } |
258 | 258 | ||
259 | static int __init numaq_update_apic(void) | ||
260 | { | ||
261 | apic->wakeup_cpu = wakeup_secondary_cpu_via_nmi; | ||
262 | |||
263 | return 0; | ||
264 | } | ||
265 | |||
266 | static struct x86_quirks numaq_x86_quirks __initdata = { | 259 | static struct x86_quirks numaq_x86_quirks __initdata = { |
267 | .arch_pre_time_init = numaq_pre_time_init, | 260 | .arch_pre_time_init = numaq_pre_time_init, |
268 | .arch_time_init = NULL, | 261 | .arch_time_init = NULL, |
@@ -278,7 +271,6 @@ static struct x86_quirks numaq_x86_quirks __initdata = { | |||
278 | .mpc_oem_pci_bus = mpc_oem_pci_bus, | 271 | .mpc_oem_pci_bus = mpc_oem_pci_bus, |
279 | .smp_read_mpc_oem = smp_read_mpc_oem, | 272 | .smp_read_mpc_oem = smp_read_mpc_oem, |
280 | .setup_ioapic_ids = numaq_setup_ioapic_ids, | 273 | .setup_ioapic_ids = numaq_setup_ioapic_ids, |
281 | .update_apic = numaq_update_apic, | ||
282 | }; | 274 | }; |
283 | 275 | ||
284 | static __init void early_check_numaq(void) | 276 | static __init void early_check_numaq(void) |
@@ -546,7 +538,7 @@ struct apic apic_numaq = { | |||
546 | .send_IPI_all = numaq_send_IPI_all, | 538 | .send_IPI_all = numaq_send_IPI_all, |
547 | .send_IPI_self = default_send_IPI_self, | 539 | .send_IPI_self = default_send_IPI_self, |
548 | 540 | ||
549 | .wakeup_cpu = NULL, | 541 | .wakeup_cpu = wakeup_secondary_cpu_via_nmi, |
550 | .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW, | 542 | .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW, |
551 | .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH, | 543 | .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH, |
552 | 544 | ||
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 3a730fa574bb..13c6fc7dff99 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
@@ -138,7 +138,7 @@ struct apic apic_default = { | |||
138 | .send_IPI_all = default_send_IPI_all, | 138 | .send_IPI_all = default_send_IPI_all, |
139 | .send_IPI_self = default_send_IPI_self, | 139 | .send_IPI_self = default_send_IPI_self, |
140 | 140 | ||
141 | .wakeup_cpu = NULL, | 141 | .wakeup_cpu = wakeup_secondary_cpu_via_init, |
142 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 142 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
143 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 143 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
144 | 144 | ||
@@ -159,6 +159,7 @@ extern struct apic apic_numaq; | |||
159 | extern struct apic apic_summit; | 159 | extern struct apic apic_summit; |
160 | extern struct apic apic_bigsmp; | 160 | extern struct apic apic_bigsmp; |
161 | extern struct apic apic_es7000; | 161 | extern struct apic apic_es7000; |
162 | extern struct apic apic_es7000_cluster; | ||
162 | extern struct apic apic_default; | 163 | extern struct apic apic_default; |
163 | 164 | ||
164 | struct apic *apic = &apic_default; | 165 | struct apic *apic = &apic_default; |
@@ -176,6 +177,7 @@ static struct apic *apic_probe[] __initdata = { | |||
176 | #endif | 177 | #endif |
177 | #ifdef CONFIG_X86_ES7000 | 178 | #ifdef CONFIG_X86_ES7000 |
178 | &apic_es7000, | 179 | &apic_es7000, |
180 | &apic_es7000_cluster, | ||
179 | #endif | 181 | #endif |
180 | &apic_default, /* must be last */ | 182 | &apic_default, /* must be last */ |
181 | NULL, | 183 | NULL, |
@@ -197,9 +199,6 @@ static int __init parse_apic(char *arg) | |||
197 | } | 199 | } |
198 | } | 200 | } |
199 | 201 | ||
200 | if (x86_quirks->update_apic) | ||
201 | x86_quirks->update_apic(); | ||
202 | |||
203 | /* Parsed again by __setup for debug/verbose */ | 202 | /* Parsed again by __setup for debug/verbose */ |
204 | return 0; | 203 | return 0; |
205 | } | 204 | } |
@@ -218,8 +217,6 @@ void __init generic_bigsmp_probe(void) | |||
218 | if (!cmdline_apic && apic == &apic_default) { | 217 | if (!cmdline_apic && apic == &apic_default) { |
219 | if (apic_bigsmp.probe()) { | 218 | if (apic_bigsmp.probe()) { |
220 | apic = &apic_bigsmp; | 219 | apic = &apic_bigsmp; |
221 | if (x86_quirks->update_apic) | ||
222 | x86_quirks->update_apic(); | ||
223 | printk(KERN_INFO "Overriding APIC driver with %s\n", | 220 | printk(KERN_INFO "Overriding APIC driver with %s\n", |
224 | apic->name); | 221 | apic->name); |
225 | } | 222 | } |
@@ -240,9 +237,6 @@ void __init generic_apic_probe(void) | |||
240 | /* Not visible without early console */ | 237 | /* Not visible without early console */ |
241 | if (!apic_probe[i]) | 238 | if (!apic_probe[i]) |
242 | panic("Didn't find an APIC driver"); | 239 | panic("Didn't find an APIC driver"); |
243 | |||
244 | if (x86_quirks->update_apic) | ||
245 | x86_quirks->update_apic(); | ||
246 | } | 240 | } |
247 | printk(KERN_INFO "Using APIC driver %s\n", apic->name); | 241 | printk(KERN_INFO "Using APIC driver %s\n", apic->name); |
248 | } | 242 | } |
@@ -262,8 +256,6 @@ generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | |||
262 | 256 | ||
263 | if (!cmdline_apic) { | 257 | if (!cmdline_apic) { |
264 | apic = apic_probe[i]; | 258 | apic = apic_probe[i]; |
265 | if (x86_quirks->update_apic) | ||
266 | x86_quirks->update_apic(); | ||
267 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", | 259 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", |
268 | apic->name); | 260 | apic->name); |
269 | } | 261 | } |
@@ -284,8 +276,6 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
284 | 276 | ||
285 | if (!cmdline_apic) { | 277 | if (!cmdline_apic) { |
286 | apic = apic_probe[i]; | 278 | apic = apic_probe[i]; |
287 | if (x86_quirks->update_apic) | ||
288 | x86_quirks->update_apic(); | ||
289 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", | 279 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", |
290 | apic->name); | 280 | apic->name); |
291 | } | 281 | } |
diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c index e7c163661c77..8d7748efe6a8 100644 --- a/arch/x86/kernel/apic/probe_64.c +++ b/arch/x86/kernel/apic/probe_64.c | |||
@@ -68,9 +68,6 @@ void __init default_setup_apic_routing(void) | |||
68 | apic = &apic_physflat; | 68 | apic = &apic_physflat; |
69 | printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); | 69 | printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); |
70 | } | 70 | } |
71 | |||
72 | if (x86_quirks->update_apic) | ||
73 | x86_quirks->update_apic(); | ||
74 | } | 71 | } |
75 | 72 | ||
76 | /* Same for both flat and physical. */ | 73 | /* Same for both flat and physical. */ |
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c index 32838b57a945..5a75d563f676 100644 --- a/arch/x86/kernel/apic/summit_32.c +++ b/arch/x86/kernel/apic/summit_32.c | |||
@@ -574,7 +574,7 @@ struct apic apic_summit = { | |||
574 | .send_IPI_all = summit_send_IPI_all, | 574 | .send_IPI_all = summit_send_IPI_all, |
575 | .send_IPI_self = default_send_IPI_self, | 575 | .send_IPI_self = default_send_IPI_self, |
576 | 576 | ||
577 | .wakeup_cpu = NULL, | 577 | .wakeup_cpu = wakeup_secondary_cpu_via_init, |
578 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 578 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
579 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 579 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
580 | 580 | ||
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index 354b9c45601d..561a6b1042ae 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
@@ -224,7 +224,7 @@ struct apic apic_x2apic_cluster = { | |||
224 | .send_IPI_all = x2apic_send_IPI_all, | 224 | .send_IPI_all = x2apic_send_IPI_all, |
225 | .send_IPI_self = x2apic_send_IPI_self, | 225 | .send_IPI_self = x2apic_send_IPI_self, |
226 | 226 | ||
227 | .wakeup_cpu = NULL, | 227 | .wakeup_cpu = wakeup_secondary_cpu_via_init, |
228 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 228 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
229 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 229 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
230 | .wait_for_init_deassert = NULL, | 230 | .wait_for_init_deassert = NULL, |
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index 5bcb174409bc..785f8ee4b1df 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c | |||
@@ -213,7 +213,7 @@ struct apic apic_x2apic_phys = { | |||
213 | .send_IPI_all = x2apic_send_IPI_all, | 213 | .send_IPI_all = x2apic_send_IPI_all, |
214 | .send_IPI_self = x2apic_send_IPI_self, | 214 | .send_IPI_self = x2apic_send_IPI_self, |
215 | 215 | ||
216 | .wakeup_cpu = NULL, | 216 | .wakeup_cpu = wakeup_secondary_cpu_via_init, |
217 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 217 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
218 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 218 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
219 | .wait_for_init_deassert = NULL, | 219 | .wait_for_init_deassert = NULL, |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 20b4ad07c3a1..6d7b9d960ddc 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -91,7 +91,7 @@ static void uv_vector_allocation_domain(int cpu, struct cpumask *retmask) | |||
91 | cpumask_set_cpu(cpu, retmask); | 91 | cpumask_set_cpu(cpu, retmask); |
92 | } | 92 | } |
93 | 93 | ||
94 | int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip) | 94 | static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) |
95 | { | 95 | { |
96 | unsigned long val; | 96 | unsigned long val; |
97 | int pnode; | 97 | int pnode; |
@@ -99,16 +99,19 @@ int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip) | |||
99 | pnode = uv_apicid_to_pnode(phys_apicid); | 99 | pnode = uv_apicid_to_pnode(phys_apicid); |
100 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | 100 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
101 | (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | | 101 | (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | |
102 | (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | | 102 | ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | |
103 | APIC_DM_INIT; | 103 | APIC_DM_INIT; |
104 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | 104 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); |
105 | mdelay(10); | 105 | mdelay(10); |
106 | 106 | ||
107 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | 107 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
108 | (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | | 108 | (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | |
109 | (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | | 109 | ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | |
110 | APIC_DM_STARTUP; | 110 | APIC_DM_STARTUP; |
111 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | 111 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); |
112 | |||
113 | atomic_set(&init_deasserted, 1); | ||
114 | |||
112 | return 0; | 115 | return 0; |
113 | } | 116 | } |
114 | 117 | ||
@@ -285,7 +288,7 @@ struct apic apic_x2apic_uv_x = { | |||
285 | .send_IPI_all = uv_send_IPI_all, | 288 | .send_IPI_all = uv_send_IPI_all, |
286 | .send_IPI_self = uv_send_IPI_self, | 289 | .send_IPI_self = uv_send_IPI_self, |
287 | 290 | ||
288 | .wakeup_cpu = NULL, | 291 | .wakeup_cpu = uv_wakeup_secondary, |
289 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 292 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
290 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 293 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
291 | .wait_for_init_deassert = NULL, | 294 | .wait_for_init_deassert = NULL, |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 5b85759e7972..2280d93c5b90 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -600,19 +600,7 @@ static int __init setup_elfcorehdr(char *arg) | |||
600 | early_param("elfcorehdr", setup_elfcorehdr); | 600 | early_param("elfcorehdr", setup_elfcorehdr); |
601 | #endif | 601 | #endif |
602 | 602 | ||
603 | static int __init default_update_apic(void) | 603 | static struct x86_quirks default_x86_quirks __initdata; |
604 | { | ||
605 | #ifdef CONFIG_SMP | ||
606 | if (!apic->wakeup_cpu) | ||
607 | apic->wakeup_cpu = wakeup_secondary_cpu_via_init; | ||
608 | #endif | ||
609 | |||
610 | return 0; | ||
611 | } | ||
612 | |||
613 | static struct x86_quirks default_x86_quirks __initdata = { | ||
614 | .update_apic = default_update_apic, | ||
615 | }; | ||
616 | 604 | ||
617 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; | 605 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; |
618 | 606 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 9ce666387f37..9b338aa03b40 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -112,7 +112,7 @@ EXPORT_PER_CPU_SYMBOL(cpu_core_map); | |||
112 | DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); | 112 | DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); |
113 | EXPORT_PER_CPU_SYMBOL(cpu_info); | 113 | EXPORT_PER_CPU_SYMBOL(cpu_info); |
114 | 114 | ||
115 | static atomic_t init_deasserted; | 115 | atomic_t init_deasserted; |
116 | 116 | ||
117 | 117 | ||
118 | /* Set if we find a B stepping CPU */ | 118 | /* Set if we find a B stepping CPU */ |
@@ -614,12 +614,6 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) | |||
614 | unsigned long send_status, accept_status = 0; | 614 | unsigned long send_status, accept_status = 0; |
615 | int maxlvt, num_starts, j; | 615 | int maxlvt, num_starts, j; |
616 | 616 | ||
617 | if (get_uv_system_type() == UV_NON_UNIQUE_APIC) { | ||
618 | send_status = uv_wakeup_secondary(phys_apicid, start_eip); | ||
619 | atomic_set(&init_deasserted, 1); | ||
620 | return send_status; | ||
621 | } | ||
622 | |||
623 | maxlvt = lapic_get_maxlvt(); | 617 | maxlvt = lapic_get_maxlvt(); |
624 | 618 | ||
625 | /* | 619 | /* |