Skip to content

Commit 7394b75

Browse files
krystian-hebelSergiiDmytruk
authored andcommitted
arch/x86/smp: don't send INIT-SIPI-SIPI if AP is already running
This is another requirement for parallel AP bringup. Signed-off-by: Krystian Hebel <[email protected]>
1 parent 4d841ed commit 7394b75

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

xen/arch/x86/smpboot.c

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -598,29 +598,38 @@ int alloc_cpu_id(void)
598598
static int do_boot_cpu(int apicid, int cpu)
599599
{
600600
int timeout, boot_error = 0, rc = 0;
601-
unsigned long start_eip;
602601

603602
/*
604603
* Save current MTRR state in case it was changed since early boot
605604
* (e.g. by the ACPI SMI) to initialize new CPUs with MTRRs in sync:
606605
*/
607606
mtrr_save_state();
608607

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);
610614

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);
614618

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);
619622

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();
621626

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);
624633

625634
if ( !boot_error )
626635
{
@@ -679,10 +688,6 @@ static int do_boot_cpu(int apicid, int cpu)
679688
rc = -EIO;
680689
}
681690

682-
/* mark "stuck" area as not stuck */
683-
bootsym(trampoline_cpu_started) = 0;
684-
smp_mb();
685-
686691
return rc;
687692
}
688693

0 commit comments

Comments
 (0)