Clear whole XMM register file instead of only XMM0. Also clear x87
registers. This brings amd64 on par with i386, providing consistent initial FPU state. Note that we do not clear any extended state, at least because kernel does not understand extended state structure and consequences of zero overwrite after fninit()/fpusave(). Submitted by: joss.upton@yahoo.com PR: 206370 MFC after: 2 weeks
This commit is contained in:
parent
c0b9f85bd6
commit
b57e68141f
@ -318,13 +318,15 @@ fpuinitstate(void *arg __unused)
|
||||
cpu_mxcsr_mask = 0xFFBF;
|
||||
|
||||
/*
|
||||
* The fninit instruction does not modify XMM registers. The
|
||||
* fpusave call dumped the garbage contained in the registers
|
||||
* after reset to the initial state saved. Clear XMM
|
||||
* registers file image to make the startup program state and
|
||||
* signal handler XMM register content predictable.
|
||||
* The fninit instruction does not modify XMM registers or x87
|
||||
* registers (MM/ST). The fpusave call dumped the garbage
|
||||
* contained in the registers after reset to the initial state
|
||||
* saved. Clear XMM and x87 registers file image to make the
|
||||
* startup program state and signal handler XMM/x87 register
|
||||
* content predictable.
|
||||
*/
|
||||
bzero(&fpu_initialstate->sv_xmm[0], sizeof(struct xmmacc));
|
||||
bzero(fpu_initialstate->sv_fp, sizeof(fpu_initialstate->sv_fp));
|
||||
bzero(fpu_initialstate->sv_xmm, sizeof(fpu_initialstate->sv_xmm));
|
||||
|
||||
/*
|
||||
* Create a table describing the layout of the CPU Extended
|
||||
|
Loading…
x
Reference in New Issue
Block a user