don't double-count maches. conf.nmach must be accurate and all maches from 0 ... conf.nmach must be valid for mmuflushes to not fault. also, give up if sipi runs out of memory. Reference: /n/atom/patch/applied2013/acpimaches Date: Fri Aug 30 21:06:45 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/k10/acpi.c Fri Aug 30 21:05:13 2013 +++ /sys/src/nix/k10/acpi.c Fri Aug 30 21:05:13 2013 @@ -527,7 +527,7 @@ case 0x00: /* Processor Local APIC */ if(p[4] & Lapicen && conf.nmach < maxmach){ lapicinit(p[3], lapicbase, nmach==0); - conf.nmach = ++nmach; + /* conf.nmach = */++nmach; } break; case 0x01: /* I/O APIC */ --- /sys/src/nix/k10/sipi.c Fri Aug 30 21:05:13 2013 +++ /sys/src/nix/k10/sipi.c Fri Aug 30 21:05:13 2013 @@ -36,7 +36,7 @@ * The Universal Startup Algorithm described in the MP Spec. 1.4. * The data needed per-processor is the sum of the stack, page * table pages, vsvm page and the Mach page. The layout is similar - * to that described in data.h for the bootstrap processor, but + * to that described in dat.h for the bootstrap processor, but * with any unused space elided. */ nproc = 0; @@ -56,7 +56,7 @@ */ alloc = mallocalign(MACHSTKSZ+4*PTSZ+4*KiB+MACHSZ, 4096, 0, 0); if(alloc == nil) - continue; + panic("sipi: no memory"); p = alloc+MACHSTKSZ; sipiptr[-1] = mmuphysaddr(PTR2UINT(p));