H. Peter Anvin wrote: >>> Ummm...last I knew, fxrstor is *expensive*. The fninit/xor regs >>> setup is likely *very* much faster. Someone should check this >>> before we sacrifice 100 cycles needlessly or something. >> >> most probably yes, fxrestor needs to read ram, pxor also takes >> some icache and bytecode ram but it sounds like it will be faster. >> >> Maybe we could also interleave the pxor with the xorps, since they >> uses different parts of the cpu, Honza? >> > > > You almost certainly should. The reason I suggested FXRSTOR is that > it would initialize the entire FPU, including any state that future > processors may add, thus reducing the likelihood of any funnies in > the future.

Here's a patch to do just that. It initializes the saved state in thetask struct and falls through to restore_fpu().