Index: sys/sparc64/conf/GENERIC =================================================================== --- sys/sparc64/conf/GENERIC +++ sys/sparc64/conf/GENERIC @@ -89,6 +89,7 @@ # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel +options EARLY_AP_STARTUP # Standard busses device ebus Index: sys/sparc64/sparc64/intr_machdep.c =================================================================== --- sys/sparc64/sparc64/intr_machdep.c +++ sys/sparc64/sparc64/intr_machdep.c @@ -109,13 +109,16 @@ /* protect intrcnt_index */ static struct mtx intrcnt_lock; -#ifdef SMP +#if defined(SMP) && !defined(EARLY_AP_STARTUP) static int assign_cpu; -static void intr_assign_next_cpu(struct intr_vector *iv); static void intr_shuffle_irqs(void *arg __unused); #endif +#ifdef SMP +static void intr_assign_next_cpu(struct intr_vector *iv); +#endif + static int intr_assign_cpu(void *arg, int cpu); static void intr_execute_handlers(void *); static void intr_stray_level(struct trapframe *); @@ -262,11 +265,16 @@ struct pcpu *pc; struct intr_vector *iv; +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); + if (cpu != NOCPU) { +#else /* * Don't do anything during early boot. We will pick up the * assignment once the APs are started. */ if (assign_cpu && cpu != NOCPU) { +#endif pc = pcpu_find(cpu); if (pc == NULL) return (EINVAL); @@ -383,9 +391,12 @@ } intr_stray_count[vec] = 0; intrcnt_updatename(vec, ie->ie_fullname, 0); -#ifdef SMP +#if defined(SMP) && !defined(EARLY_AP_STARTUP) if (assign_cpu) intr_assign_next_cpu(iv); +#elif defined(SMP) && defined(EARLY_AP_STARTUP) + MPASS(mp_ncpus == 1 || smp_started); + intr_assign_next_cpu(iv); #endif ic->ic_enable(iv); /* Ensure the interrupt is cleared, it might have triggered before. */ @@ -517,6 +528,7 @@ CPU_SET(cpu, &intr_cpus); } +#ifndef EARLY_AP_STARTUP /* * Distribute all the interrupt sources among the available CPUs once the * APs have been launched. @@ -555,3 +567,4 @@ SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs, NULL); #endif +#endif Index: sys/sparc64/sparc64/mp_machdep.c =================================================================== --- sys/sparc64/sparc64/mp_machdep.c +++ sys/sparc64/sparc64/mp_machdep.c @@ -471,8 +471,10 @@ if (smp_cpus == mp_ncpus) atomic_store_rel_int(&smp_started, 1); +#ifndef EARLY_AP_STARTUP /* Start per-CPU event timers. */ cpu_initclocks_ap(); +#endif /* Ok, now enter the scheduler. */ sched_throw(NULL);