On Sun, Dec 26, 2010 at 7:24 AM, Mark Kettenis <mark.kettenis@xs4all.nl>
wrote:
Well, on i386, npxinit() is called for the primary cpu when the npx is
attached, which is way after the secondary cpus are attached. Can we
assume it to be safe to call npxinit() before the npx device is
attached? It wouldn't surprise me to hear that it only works when npx
errors are reported using exceptions and not ISA interrupts...which
would explain why the early calls are fine on multi-CPU systems,
'cause they all use exceptions.
So no, I don't think it's safe to move up the npxinit() call into
cpu_init(), unless you're suggesting that we delay initializing
secondary cpus until after the isa bus is probed (barf). The
consistent alternative would be to leave the fpuinit() call in
cpu_hatch() and call it for the primary cpu near the end of
init_x86_64(), that being the rough equivalent for the primary cpu.
No. The primary cpu check is necessary, at least on i386, because
secondary cpus call npxinit() before the primary cpu *and* before
setting CR4_OSFXSR.
(Also, you're not planning on hot-upgrading your FPU by replacing the
CPU while it's asleep?!)
1.25
Yes, I agree. IMO, that can be committed separately (ok guenther@)
from this mxcsr_mask diff.
What this really points out, however, is that the masking added by my
diff was in the wrong function: it should have been in
process_write_xmmregs(), duh. I'll fix that in the next rev.
Once we agree where to npxinit()/fpuinit(), I'll post an updated diff.
Philip Guenther