we can encounter machines that support pae, but not mwait. work around this issue. Reference: /n/atom/patch/applied/paewomwait Date: Sun May 31 02:33:57 CES 2015 Signed-off-by: quanstro@quanstro.net --- /sys/src/9/pcpae/devarch.c Sun May 31 02:33:40 2015 +++ /sys/src/9/pcpae/devarch.c Sun May 31 02:33:42 2015 @@ -688,6 +688,25 @@ print(buf); } +u64int +nopmonmwait64(u64int *p, u64int v) +{ + if(*p == v) + pause(); + return *p; +} + +u32int +nopmonmwait32(u32int *p, u32int v) +{ + if(*p == v) + pause(); + return *p; +} + +u64int (*monmwait64)(u64int*, u64int) = nopmonmwait64; +u32int (*monmwait32)(u32int*, u32int) = nopmonmwait32; + /* * figure out: * - cpu type @@ -698,6 +717,7 @@ * (if so turn it on) * - whether or not it supports the page global flag * (if so turn it on) + * - if monmwait is availabile */ int cpuidentify(void) @@ -718,6 +738,10 @@ cpuid(Procsig, ®s); m->cpuidax = regs.ax; m->cpuiddx = regs.dx; + if(regs.cx & 8){ +// monmwait64 = k10monmwait64; + monmwait32 = k10monmwait32; + } if(strncmp(m->cpuidid, "AuthenticAMD", 12) == 0 || strncmp(m->cpuidid, "Geode by NSC", 12) == 0)