diff options
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index d5274b6b088e..c5392058cd07 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <asm/mtrr.h> | 62 | #include <asm/mtrr.h> |
63 | #include <asm/vmi.h> | 63 | #include <asm/vmi.h> |
64 | #include <asm/genapic.h> | 64 | #include <asm/genapic.h> |
65 | #include <asm/setup.h> | ||
65 | #include <linux/mc146818rtc.h> | 66 | #include <linux/mc146818rtc.h> |
66 | 67 | ||
67 | #include <mach_apic.h> | 68 | #include <mach_apic.h> |
@@ -281,16 +282,14 @@ static int __cpuinitdata unsafe_smp; | |||
281 | /* | 282 | /* |
282 | * Activate a secondary processor. | 283 | * Activate a secondary processor. |
283 | */ | 284 | */ |
284 | static void __cpuinit start_secondary(void *unused) | 285 | notrace static void __cpuinit start_secondary(void *unused) |
285 | { | 286 | { |
286 | /* | 287 | /* |
287 | * Don't put *anything* before cpu_init(), SMP booting is too | 288 | * Don't put *anything* before cpu_init(), SMP booting is too |
288 | * fragile that we want to limit the things done here to the | 289 | * fragile that we want to limit the things done here to the |
289 | * most necessary things. | 290 | * most necessary things. |
290 | */ | 291 | */ |
291 | #ifdef CONFIG_VMI | ||
292 | vmi_bringup(); | 292 | vmi_bringup(); |
293 | #endif | ||
294 | cpu_init(); | 293 | cpu_init(); |
295 | preempt_disable(); | 294 | preempt_disable(); |
296 | smp_callin(); | 295 | smp_callin(); |
@@ -535,7 +534,7 @@ static void impress_friends(void) | |||
535 | pr_debug("Before bogocount - setting activated=1.\n"); | 534 | pr_debug("Before bogocount - setting activated=1.\n"); |
536 | } | 535 | } |
537 | 536 | ||
538 | static inline void __inquire_remote_apic(int apicid) | 537 | void __inquire_remote_apic(int apicid) |
539 | { | 538 | { |
540 | unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 }; | 539 | unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 }; |
541 | char *names[] = { "ID", "VERSION", "SPIV" }; | 540 | char *names[] = { "ID", "VERSION", "SPIV" }; |
@@ -574,14 +573,13 @@ static inline void __inquire_remote_apic(int apicid) | |||
574 | } | 573 | } |
575 | } | 574 | } |
576 | 575 | ||
577 | #ifdef WAKE_SECONDARY_VIA_NMI | ||
578 | /* | 576 | /* |
579 | * Poke the other CPU in the eye via NMI to wake it up. Remember that the normal | 577 | * Poke the other CPU in the eye via NMI to wake it up. Remember that the normal |
580 | * INIT, INIT, STARTUP sequence will reset the chip hard for us, and this | 578 | * INIT, INIT, STARTUP sequence will reset the chip hard for us, and this |
581 | * won't ... remember to clear down the APIC, etc later. | 579 | * won't ... remember to clear down the APIC, etc later. |
582 | */ | 580 | */ |
583 | static int __devinit | 581 | int __devinit |
584 | wakeup_secondary_cpu(int logical_apicid, unsigned long start_eip) | 582 | wakeup_secondary_cpu_via_nmi(int logical_apicid, unsigned long start_eip) |
585 | { | 583 | { |
586 | unsigned long send_status, accept_status = 0; | 584 | unsigned long send_status, accept_status = 0; |
587 | int maxlvt; | 585 | int maxlvt; |
@@ -598,7 +596,7 @@ wakeup_secondary_cpu(int logical_apicid, unsigned long start_eip) | |||
598 | * Give the other CPU some time to accept the IPI. | 596 | * Give the other CPU some time to accept the IPI. |
599 | */ | 597 | */ |
600 | udelay(200); | 598 | udelay(200); |
601 | if (APIC_INTEGRATED(apic_version[phys_apicid])) { | 599 | if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) { |
602 | maxlvt = lapic_get_maxlvt(); | 600 | maxlvt = lapic_get_maxlvt(); |
603 | if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ | 601 | if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ |
604 | apic_write(APIC_ESR, 0); | 602 | apic_write(APIC_ESR, 0); |
@@ -613,11 +611,9 @@ wakeup_secondary_cpu(int logical_apicid, unsigned long start_eip) | |||
613 | 611 | ||
614 | return (send_status | accept_status); | 612 | return (send_status | accept_status); |
615 | } | 613 | } |
616 | #endif /* WAKE_SECONDARY_VIA_NMI */ | ||
617 | 614 | ||
618 | #ifdef WAKE_SECONDARY_VIA_INIT | 615 | int __devinit |
619 | static int __devinit | 616 | wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) |
620 | wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip) | ||
621 | { | 617 | { |
622 | unsigned long send_status, accept_status = 0; | 618 | unsigned long send_status, accept_status = 0; |
623 | int maxlvt, num_starts, j; | 619 | int maxlvt, num_starts, j; |
@@ -736,7 +732,6 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip) | |||
736 | 732 | ||
737 | return (send_status | accept_status); | 733 | return (send_status | accept_status); |
738 | } | 734 | } |
739 | #endif /* WAKE_SECONDARY_VIA_INIT */ | ||
740 | 735 | ||
741 | struct create_idle { | 736 | struct create_idle { |
742 | struct work_struct work; | 737 | struct work_struct work; |
@@ -1085,8 +1080,10 @@ static int __init smp_sanity_check(unsigned max_cpus) | |||
1085 | #endif | 1080 | #endif |
1086 | 1081 | ||
1087 | if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) { | 1082 | if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) { |
1088 | printk(KERN_WARNING "weird, boot CPU (#%d) not listed" | 1083 | printk(KERN_WARNING |
1089 | "by the BIOS.\n", hard_smp_processor_id()); | 1084 | "weird, boot CPU (#%d) not listed by the BIOS.\n", |
1085 | hard_smp_processor_id()); | ||
1086 | |||
1090 | physid_set(hard_smp_processor_id(), phys_cpu_present_map); | 1087 | physid_set(hard_smp_processor_id(), phys_cpu_present_map); |
1091 | } | 1088 | } |
1092 | 1089 | ||