Honor maxcores retry. Reference: /n/patches.lsub.org/patch/mpacpifix.1 Date: Mon Jul 16 11:33:55 CES 2012 Signed-off-by: paurea@lsub.org --- /sys/src/nix/k10/mp.c Thu Jul 12 15:17:52 2012 +++ /sys/src/nix/k10/mp.c Mon Jul 16 11:33:18 2012 @@ -417,7 +417,7 @@ mpsinit(int maxcores) { u8int *p; - int i, n; + int i, n, ncleft; _MP_ *mp; PCMP *pcmp; @@ -479,8 +479,8 @@ * for later interrupt enabling and application processor * startup. */ - maxcores = mpparse(pcmp, maxcores); - mpacpi(maxcores); + ncleft = mpparse(pcmp, maxcores); + mpacpi(ncleft, maxcores - ncleft); apicdump(); ioapicdump(); --- /sys/src/nix/k10/mpacpi.c Thu Jul 5 23:25:04 2012 +++ /sys/src/nix/k10/mpacpi.c Mon Jul 16 11:26:11 2012 @@ -11,13 +11,14 @@ extern Madt *apics; int -mpacpi(int maxcores) +mpacpi(int ncleft, int ncdone) { char *already; - int np, bp; + int np, bp, nt; Apic *apic; Apicst *st; + nt = ncleft + ncdone; print("APIC lapic paddr %#.8llux, flags %#.8ux\n", apics->lapicpa, apics->pcat); np = 0; @@ -25,10 +26,11 @@ already = ""; switch(st->type){ case ASlapic: - if(st->lapic.id > Napic || np == maxcores) + /* this table is supposed to have all of them if it exists */ + if(st->lapic.id > Napic || np == nt) break; apic = xlapic + st->lapic.id; - bp = (np++ == 0); + bp = (np++ == 0) && ncdone == 0; if(apic->useable){ already = "(mp)"; goto pr; @@ -53,5 +55,5 @@ break; } } - return maxcores - np; + return nt - np; }