@@ -598,29 +598,38 @@ int alloc_cpu_id(void)
598
598
static int do_boot_cpu (int apicid , int cpu )
599
599
{
600
600
int timeout , boot_error = 0 , rc = 0 ;
601
- unsigned long start_eip ;
602
601
603
602
/*
604
603
* Save current MTRR state in case it was changed since early boot
605
604
* (e.g. by the ACPI SMI) to initialize new CPUs with MTRRs in sync:
606
605
*/
607
606
mtrr_save_state ();
608
607
609
- start_eip = bootsym_phys (entry_SIPI16 );
608
+ /* Check if AP is already up. */
609
+ if ( cpu_state [cpu ] != CPU_STATE_INIT )
610
+ {
611
+ /* This grunge runs the startup process for the targeted processor. */
612
+ unsigned long start_eip ;
613
+ start_eip = bootsym_phys (entry_SIPI16 );
610
614
611
- /* start_eip needs be page aligned, and below the 1M boundary. */
612
- if ( start_eip & ~0xff000 )
613
- panic ("AP trampoline %#lx not suitably positioned\n" , start_eip );
615
+ /* start_eip needs be page aligned, and below the 1M boundary. */
616
+ if ( start_eip & ~0xff000 )
617
+ panic ("AP trampoline %#lx not suitably positioned\n" , start_eip );
614
618
615
- /* So we see what's up */
616
- if ( opt_cpu_info )
617
- printk ("Booting processor %d/%d eip %lx\n" ,
618
- cpu , apicid , start_eip );
619
+ /* So we see what's up */
620
+ if ( opt_cpu_info )
621
+ printk ("AP trampoline at %lx\n" , start_eip );
619
622
620
- /* This grunge runs the startup process for the targeted processor. */
623
+ /* mark "stuck" area as not stuck */
624
+ bootsym (trampoline_cpu_started ) = 0 ;
625
+ smp_mb ();
621
626
622
- /* Starting actual IPI sequence... */
623
- boot_error = wakeup_secondary_cpu (apicid , start_eip );
627
+ /* Starting actual IPI sequence... */
628
+ boot_error = wakeup_secondary_cpu (apicid , start_eip );
629
+ }
630
+
631
+ if ( opt_cpu_info )
632
+ printk ("Booting processor %d/%d\n" , cpu , apicid );
624
633
625
634
if ( !boot_error )
626
635
{
@@ -679,10 +688,6 @@ static int do_boot_cpu(int apicid, int cpu)
679
688
rc = - EIO ;
680
689
}
681
690
682
- /* mark "stuck" area as not stuck */
683
- bootsym (trampoline_cpu_started ) = 0 ;
684
- smp_mb ();
685
-
686
691
return rc ;
687
692
}
688
693
0 commit comments