]> CyberLeo.Net >> Repos - FreeBSD/releng/8.0.git/blob - sys/sparc64/sparc64/mp_machdep.c
Adjust to reflect 8.0-RELEASE.
[FreeBSD/releng/8.0.git] / sys / sparc64 / sparc64 / mp_machdep.c
1 /*-
2  * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  * 3. Berkeley Software Design Inc's name may not be used to endorse or
13  *    promote products derived from this software without specific prior
14  *    written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN INC ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN INC BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * from BSDI: locore.s,v 1.36.2.15 1999/08/23 22:34:41 cp Exp
29  */
30 /*-
31  * Copyright (c) 2002 Jake Burkholder.
32  * Copyright (c) 2007 Marius Strobl <marius@FreeBSD.org>
33  * All rights reserved.
34  *
35  * Redistribution and use in source and binary forms, with or without
36  * modification, are permitted provided that the following conditions
37  * are met:
38  * 1. Redistributions of source code must retain the above copyright
39  *    notice, this list of conditions and the following disclaimer.
40  * 2. Redistributions in binary form must reproduce the above copyright
41  *    notice, this list of conditions and the following disclaimer in the
42  *    documentation and/or other materials provided with the distribution.
43  *
44  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
45  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
48  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54  * SUCH DAMAGE.
55  */
56
57 #include <sys/cdefs.h>
58 __FBSDID("$FreeBSD$");
59
60 #include <sys/param.h>
61 #include <sys/systm.h>
62 #include <sys/lock.h>
63 #include <sys/kdb.h>
64 #include <sys/kernel.h>
65 #include <sys/ktr.h>
66 #include <sys/mutex.h>
67 #include <sys/pcpu.h>
68 #include <sys/proc.h>
69 #include <sys/sched.h>
70 #include <sys/smp.h>
71
72 #include <vm/vm.h>
73 #include <vm/vm_param.h>
74 #include <vm/pmap.h>
75 #include <vm/vm_kern.h>
76 #include <vm/vm_extern.h>
77 #include <vm/vm_map.h>
78
79 #include <dev/ofw/openfirm.h>
80
81 #include <machine/asi.h>
82 #include <machine/atomic.h>
83 #include <machine/bus.h>
84 #include <machine/cpu.h>
85 #include <machine/md_var.h>
86 #include <machine/metadata.h>
87 #include <machine/ofw_machdep.h>
88 #include <machine/pcb.h>
89 #include <machine/smp.h>
90 #include <machine/tick.h>
91 #include <machine/tlb.h>
92 #include <machine/tte.h>
93 #include <machine/ver.h>
94
95 #define SUNW_STARTCPU           "SUNW,start-cpu"
96 #define SUNW_STOPSELF           "SUNW,stop-self"
97
98 static ih_func_t cpu_ipi_ast;
99 static ih_func_t cpu_ipi_preempt;
100 static ih_func_t cpu_ipi_stop;
101
102 /*
103  * Argument area used to pass data to non-boot processors as they start up.
104  * This must be statically initialized with a known invalid CPU module ID,
105  * since the other processors will use it before the boot CPU enters the
106  * kernel.
107  */
108 struct  cpu_start_args cpu_start_args = { 0, -1, -1, 0, 0, 0 };
109 struct  ipi_cache_args ipi_cache_args;
110 struct  ipi_tlb_args ipi_tlb_args;
111 struct  pcb stoppcbs[MAXCPU];
112
113 struct  mtx ipi_mtx;
114
115 cpu_ipi_selected_t *cpu_ipi_selected;
116
117 static vm_offset_t mp_tramp;
118 static u_int cpuid_to_mid[MAXCPU];
119 static int isjbus;
120 static volatile u_int shutdown_cpus;
121
122 static void cpu_mp_unleash(void *v);
123 static void spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2);
124 static void sun4u_startcpu(phandle_t cpu, void *func, u_long arg);
125
126 static cpu_ipi_selected_t cheetah_ipi_selected;
127 static cpu_ipi_selected_t spitfire_ipi_selected;
128
129 SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL);
130
131 CTASSERT(MAXCPU <= IDR_CHEETAH_MAX_BN_PAIRS);
132 CTASSERT(MAXCPU <= sizeof(u_int) * NBBY);
133 CTASSERT(MAXCPU <= sizeof(int) * NBBY);
134
135 void
136 mp_init(void)
137 {
138         struct tte *tp;
139         int i;
140
141         mp_tramp = (vm_offset_t)OF_claim(NULL, PAGE_SIZE, PAGE_SIZE);
142         if (mp_tramp == (vm_offset_t)-1)
143                 panic("%s", __func__);
144         bcopy(mp_tramp_code, (void *)mp_tramp, mp_tramp_code_len);
145         *(vm_offset_t *)(mp_tramp + mp_tramp_tlb_slots) = kernel_tlb_slots;
146         *(vm_offset_t *)(mp_tramp + mp_tramp_func) = (vm_offset_t)mp_startup;
147         tp = (struct tte *)(mp_tramp + mp_tramp_code_len);
148         for (i = 0; i < kernel_tlb_slots; i++) {
149                 tp[i].tte_vpn = TV_VPN(kernel_tlbs[i].te_va, TS_4M);
150                 tp[i].tte_data = TD_V | TD_4M | TD_PA(kernel_tlbs[i].te_pa) |
151                     TD_L | TD_CP | TD_CV | TD_P | TD_W;
152         }
153         for (i = 0; i < PAGE_SIZE; i += sizeof(vm_offset_t))
154                 flush(mp_tramp + i);
155
156         /*
157          * On UP systems cpu_ipi_selected() can be called while
158          * cpu_mp_start() wasn't so initialize these here.
159          */
160         if (cpu_impl == CPU_IMPL_ULTRASPARCIIIi ||
161             cpu_impl == CPU_IMPL_ULTRASPARCIIIip)
162                 isjbus = 1;
163         if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
164                 cpu_ipi_selected = cheetah_ipi_selected;
165         else
166                 cpu_ipi_selected = spitfire_ipi_selected;
167 }
168
169 /*
170  * Probe for other CPUs.
171  */
172 void
173 cpu_mp_setmaxid(void)
174 {
175         char buf[128];
176         phandle_t child;
177         u_int cpus;
178
179         all_cpus = 1 << curcpu;
180         mp_ncpus = 1;
181
182         cpus = 0;
183         for (child = OF_child(OF_peer(0)); child != 0; child = OF_peer(child))
184                 if (OF_getprop(child, "device_type", buf, sizeof(buf)) > 0 &&
185                     strcmp(buf, "cpu") == 0)
186                         cpus++;
187         mp_maxid = cpus - 1;
188 }
189
190 int
191 cpu_mp_probe(void)
192 {
193
194         return (mp_maxid > 0);
195 }
196
197 struct cpu_group *
198 cpu_topo(void)
199 {
200
201         return (smp_topo_none());
202 }
203
204 static void
205 sun4u_startcpu(phandle_t cpu, void *func, u_long arg)
206 {
207         static struct {
208                 cell_t  name;
209                 cell_t  nargs;
210                 cell_t  nreturns;
211                 cell_t  cpu;
212                 cell_t  func;
213                 cell_t  arg;
214         } args = {
215                 (cell_t)SUNW_STARTCPU,
216                 3,
217         };
218
219         args.cpu = cpu;
220         args.func = (cell_t)func;
221         args.arg = (cell_t)arg;
222         ofw_entry(&args);
223 }
224
225 /*
226  * Fire up any non-boot processors.
227  */
228 void
229 cpu_mp_start(void)
230 {
231         char buf[128];
232         volatile struct cpu_start_args *csa;
233         struct pcpu *pc;
234         register_t s;
235         vm_offset_t va;
236         phandle_t child;
237         u_int mid;
238         u_int clock;
239         u_int cpuid;
240
241         mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN);
242
243         intr_setup(PIL_AST, cpu_ipi_ast, -1, NULL, NULL);
244         intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action,
245             -1, NULL, NULL);
246         intr_setup(PIL_STOP, cpu_ipi_stop, -1, NULL, NULL);
247         intr_setup(PIL_PREEMPT, cpu_ipi_preempt, -1, NULL, NULL);
248
249         cpuid_to_mid[curcpu] = PCPU_GET(mid);
250
251         csa = &cpu_start_args;
252         for (child = OF_child(OF_peer(0)); child != 0 && mp_ncpus <= MAXCPU;
253             child = OF_peer(child)) {
254                 if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0 ||
255                     strcmp(buf, "cpu") != 0)
256                         continue;
257                 if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ?
258                     "upa-portid" : "portid", &mid, sizeof(mid)) <= 0)
259                         panic("%s: can't get module ID", __func__);
260                 if (mid == PCPU_GET(mid))
261                         continue;
262                 if (OF_getprop(child, "clock-frequency", &clock,
263                     sizeof(clock)) <= 0)
264                         panic("%s: can't get clock", __func__);
265                 if (clock != PCPU_GET(clock))
266                         hardclock_use_stick = 1;
267
268                 csa->csa_state = 0;
269                 sun4u_startcpu(child, (void *)mp_tramp, 0);
270                 s = intr_disable();
271                 while (csa->csa_state != CPU_TICKSYNC)
272                         ;
273                 membar(StoreLoad);
274                 csa->csa_tick = rd(tick);
275                 if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) {
276                         while (csa->csa_state != CPU_STICKSYNC)
277                                 ;
278                         membar(StoreLoad);
279                         csa->csa_stick = rdstick();
280                 }
281                 while (csa->csa_state != CPU_INIT)
282                         ;
283                 csa->csa_tick = csa->csa_stick = 0;
284                 intr_restore(s);
285
286                 cpuid = mp_ncpus++;
287                 cpuid_to_mid[cpuid] = mid;
288                 cpu_identify(csa->csa_ver, clock, cpuid);
289
290                 va = kmem_alloc(kernel_map, PCPU_PAGES * PAGE_SIZE);
291                 pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1;
292                 pcpu_init(pc, cpuid, sizeof(*pc));
293                 dpcpu_init((void *)kmem_alloc(kernel_map, DPCPU_SIZE),
294                     cpuid);
295                 pc->pc_addr = va;
296                 pc->pc_clock = clock;
297                 pc->pc_mid = mid;
298                 pc->pc_node = child;
299
300                 cache_init(pc);
301
302                 all_cpus |= 1 << cpuid;
303                 intr_add_cpu(cpuid);
304         }
305         KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS,
306             ("%s: can only IPI a maximum of %d JBus-CPUs",
307             __func__, IDR_JALAPENO_MAX_BN_PAIRS));
308         PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu));
309         smp_active = 1;
310 }
311
312 void
313 cpu_mp_announce(void)
314 {
315
316 }
317
318 static void
319 cpu_mp_unleash(void *v)
320 {
321         volatile struct cpu_start_args *csa;
322         struct pcpu *pc;
323         register_t s;
324         vm_offset_t va;
325         vm_paddr_t pa;
326         u_int ctx_inc;
327         u_int ctx_min;
328         int i;
329
330         ctx_min = TLB_CTX_USER_MIN;
331         ctx_inc = (TLB_CTX_USER_MAX - 1) / mp_ncpus;
332         csa = &cpu_start_args;
333         csa->csa_count = mp_ncpus;
334         SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
335                 pc->pc_tlb_ctx = ctx_min;
336                 pc->pc_tlb_ctx_min = ctx_min;
337                 pc->pc_tlb_ctx_max = ctx_min + ctx_inc;
338                 ctx_min += ctx_inc;
339
340                 if (pc->pc_cpuid == curcpu)
341                         continue;
342                 KASSERT(pc->pc_idlethread != NULL,
343                     ("%s: idlethread", __func__));
344                 pc->pc_curthread = pc->pc_idlethread;
345                 pc->pc_curpcb = pc->pc_curthread->td_pcb;
346                 for (i = 0; i < PCPU_PAGES; i++) {
347                         va = pc->pc_addr + i * PAGE_SIZE;
348                         pa = pmap_kextract(va);
349                         if (pa == 0)
350                                 panic("%s: pmap_kextract", __func__);
351                         csa->csa_ttes[i].tte_vpn = TV_VPN(va, TS_8K);
352                         csa->csa_ttes[i].tte_data = TD_V | TD_8K | TD_PA(pa) |
353                             TD_L | TD_CP | TD_CV | TD_P | TD_W;
354                 }
355                 csa->csa_state = 0;
356                 csa->csa_pcpu = pc->pc_addr;
357                 csa->csa_mid = pc->pc_mid;
358                 s = intr_disable();
359                 while (csa->csa_state != CPU_BOOTSTRAP)
360                         ;
361                 intr_restore(s);
362         }
363
364         membar(StoreLoad);
365         csa->csa_count = 0;
366         smp_started = 1;
367 }
368
369 void
370 cpu_mp_bootstrap(struct pcpu *pc)
371 {
372         volatile struct cpu_start_args *csa;
373
374         csa = &cpu_start_args;
375         if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
376                 cheetah_init();
377         cache_enable();
378         pmap_map_tsb();
379         /*
380          * Flush all non-locked TLB entries possibly left over by the
381          * firmware.
382          */
383         tlb_flush_nonlocked();
384         cpu_setregs(pc);
385         tick_start();
386
387         smp_cpus++;
388         KASSERT(curthread != NULL, ("%s: curthread", __func__));
389         PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu));
390         printf("SMP: AP CPU #%d Launched!\n", curcpu);
391
392         csa->csa_count--;
393         membar(StoreLoad);
394         csa->csa_state = CPU_BOOTSTRAP;
395         while (csa->csa_count != 0)
396                 ;
397
398         /* Ok, now enter the scheduler. */
399         sched_throw(NULL);
400 }
401
402 void
403 cpu_mp_shutdown(void)
404 {
405         int i;
406
407         critical_enter();
408         shutdown_cpus = PCPU_GET(other_cpus);
409         if (stopped_cpus != PCPU_GET(other_cpus))       /* XXX */
410                 stop_cpus(stopped_cpus ^ PCPU_GET(other_cpus));
411         i = 0;
412         while (shutdown_cpus != 0) {
413                 if (i++ > 100000) {
414                         printf("timeout shutting down CPUs.\n");
415                         break;
416                 }
417         }
418         critical_exit();
419 }
420
421 static void
422 cpu_ipi_ast(struct trapframe *tf)
423 {
424
425 }
426
427 static void
428 cpu_ipi_stop(struct trapframe *tf)
429 {
430
431         CTR2(KTR_SMP, "%s: stopped %d", __func__, curcpu);
432         savectx(&stoppcbs[curcpu]);
433         atomic_set_acq_int(&stopped_cpus, PCPU_GET(cpumask));
434         while ((started_cpus & PCPU_GET(cpumask)) == 0) {
435                 if ((shutdown_cpus & PCPU_GET(cpumask)) != 0) {
436                         atomic_clear_int(&shutdown_cpus, PCPU_GET(cpumask));
437                         (void)intr_disable();
438                         for (;;)
439                                 ;
440                 }
441         }
442         atomic_clear_rel_int(&started_cpus, PCPU_GET(cpumask));
443         atomic_clear_rel_int(&stopped_cpus, PCPU_GET(cpumask));
444         CTR2(KTR_SMP, "%s: restarted %d", __func__, curcpu);
445 }
446
447 static void
448 cpu_ipi_preempt(struct trapframe *tf)
449 {
450
451         sched_preempt(curthread);
452 }
453
454 static void
455 spitfire_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
456 {
457         u_int cpu;
458
459         KASSERT((cpus & (1 << curcpu)) == 0,
460             ("%s: CPU can't IPI itself", __func__));
461         while (cpus) {
462                 cpu = ffs(cpus) - 1;
463                 cpus &= ~(1 << cpu);
464                 spitfire_ipi_send(cpuid_to_mid[cpu], d0, d1, d2);
465         }
466 }
467
468 static void
469 spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2)
470 {
471         register_t s;
472         u_long ids;
473         int i;
474
475         KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) & IDR_BUSY) == 0,
476             ("%s: outstanding dispatch", __func__));
477         for (i = 0; i < IPI_RETRIES; i++) {
478                 s = intr_disable();
479                 stxa(AA_SDB_INTR_D0, ASI_SDB_INTR_W, d0);
480                 stxa(AA_SDB_INTR_D1, ASI_SDB_INTR_W, d1);
481                 stxa(AA_SDB_INTR_D2, ASI_SDB_INTR_W, d2);
482                 membar(Sync);
483                 stxa(AA_INTR_SEND | (mid << IDC_ITID_SHIFT),
484                     ASI_SDB_INTR_W, 0);
485                 /*
486                  * Workaround for SpitFire erratum #54; do a dummy read
487                  * from a SDB internal register before the MEMBAR #Sync
488                  * for the write to ASI_SDB_INTR_W (requiring another
489                  * MEMBAR #Sync in order to make sure the write has
490                  * occurred before the load).
491                  */
492                 membar(Sync);
493                 (void)ldxa(AA_SDB_CNTL_HIGH, ASI_SDB_CONTROL_R);
494                 membar(Sync);
495                 while (((ids = ldxa(0, ASI_INTR_DISPATCH_STATUS)) &
496                     IDR_BUSY) != 0)
497                         ;
498                 intr_restore(s);
499                 if ((ids & (IDR_BUSY | IDR_NACK)) == 0)
500                         return;
501                 /*
502                  * Leave interrupts enabled for a bit before retrying
503                  * in order to avoid deadlocks if the other CPU is also
504                  * trying to send an IPI.
505                  */
506                 DELAY(2);
507         }
508         if (kdb_active != 0 || panicstr != NULL)
509                 printf("%s: couldn't send IPI to module 0x%u\n",
510                     __func__, mid);
511         else
512                 panic("%s: couldn't send IPI to module 0x%u",
513                     __func__, mid);
514 }
515
516 static void
517 cheetah_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
518 {
519         register_t s;
520         u_long ids;
521         u_int bnp;
522         u_int cpu;
523         int i;
524
525         KASSERT((cpus & (1 << curcpu)) == 0,
526             ("%s: CPU can't IPI itself", __func__));
527         KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) &
528             IDR_CHEETAH_ALL_BUSY) == 0,
529             ("%s: outstanding dispatch", __func__));
530         if (cpus == 0)
531                 return;
532         ids = 0;
533         for (i = 0; i < IPI_RETRIES * mp_ncpus; i++) {
534                 s = intr_disable();
535                 stxa(AA_SDB_INTR_D0, ASI_SDB_INTR_W, d0);
536                 stxa(AA_SDB_INTR_D1, ASI_SDB_INTR_W, d1);
537                 stxa(AA_SDB_INTR_D2, ASI_SDB_INTR_W, d2);
538                 membar(Sync);
539                 bnp = 0;
540                 for (cpu = 0; cpu < mp_ncpus; cpu++) {
541                         if ((cpus & (1 << cpu)) != 0) {
542                                 stxa(AA_INTR_SEND |
543                                     (cpuid_to_mid[cpu] << IDC_ITID_SHIFT) |
544                                     (isjbus ? 0 : bnp << IDC_BN_SHIFT),
545                                     ASI_SDB_INTR_W, 0);
546                                 membar(Sync);
547                                 bnp++;
548                         }
549                 }
550                 while (((ids = ldxa(0, ASI_INTR_DISPATCH_STATUS)) &
551                     IDR_CHEETAH_ALL_BUSY) != 0)
552                         ;
553                 intr_restore(s);
554                 if ((ids & (IDR_CHEETAH_ALL_BUSY | IDR_CHEETAH_ALL_NACK)) == 0)
555                         return;
556                 bnp = 0;
557                 for (cpu = 0; cpu < mp_ncpus; cpu++) {
558                         if ((cpus & (1 << cpu)) != 0) {
559                                 if ((ids & (IDR_NACK << (isjbus ?
560                                     (2 * cpuid_to_mid[cpu]) :
561                                     (2 * bnp)))) == 0)
562                                         cpus &= ~(1 << cpu);
563                                 bnp++;
564                         }
565                 }
566                 /*
567                  * On at least Fire V880 we may receive IDR_NACKs for
568                  * CPUs we actually haven't tried to send an IPI to,
569                  * but which apparently can be safely ignored.
570                  */
571                 if (cpus == 0)
572                         return;
573                 /*
574                  * Leave interrupts enabled for a bit before retrying
575                  * in order to avoid deadlocks if the other CPUs are
576                  * also trying to send IPIs.
577                  */
578                 DELAY(2 * mp_ncpus);
579         }
580         if (kdb_active != 0 || panicstr != NULL)
581                 printf("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)\n",
582                     __func__, cpus, ids);
583         else
584                 panic("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)",
585                     __func__, cpus, ids);
586 }