Send a ipi to wakeup the core in a role change. Reference: /n/patches.lsub.org/patch/ipiroles Date: Thu Jul 5 15:29:38 CES 2012 Signed-off-by: paurea@lsub.org --- /sys/src/nix/k10/tcore.c Tue Jul 3 10:40:23 2012 +++ /sys/src/nix/k10/tcore.c Thu Jul 5 15:28:12 2012 @@ -218,8 +218,8 @@ mp->nixrole = NIXSC; mp->qexpired = 1; coherence(); - /* when idlehands sleeps, this needs to send a wake it up IPI? */ - //this breaks the core now... (ipi a TC?) apicipi(mp->apicno); + /* in case the core is sleeping */ + apicipi(mp->apicno); sleep(&mp->sipir, donequiesce, mp); /* fall */ --- /sys/src/nix/k10/trap.c Thu Jun 14 09:36:24 2012 +++ /sys/src/nix/k10/trap.c Thu Jul 5 15:27:28 2012 @@ -17,8 +17,8 @@ static void debugbpt(Ureg*, void*); static void faultamd64(Ureg*, void*); static void doublefault(Ureg*, void*); +static void ipihdler(Ureg*, void*); static void unexpected(Ureg*, void*); -static void expected(Ureg*, void*); static void dumpstackwithureg(Ureg*); static Lock vctllock; @@ -202,7 +202,7 @@ trapenable(VectorBPT, debugbpt, 0, "#BP"); trapenable(VectorPF, faultamd64, 0, "#PF"); trapenable(Vector2F, doublefault, 0, "#DF"); - intrenable(IdtIPI, expected, 0, BUSUNKNOWN, "#IPI"); + intrenable(IdtIPI, ipihdler, 0, BUSUNKNOWN, "#IPI"); trapenable(Vector15, unexpected, 0, "#15"); nmienable(); @@ -595,8 +595,12 @@ } static void -expected(Ureg*, void*) +ipihdler(Ureg*, void*) { + coherence(); + if(isbooting(m) && m->proc == nil){ + tcquiesce(); + } } static void