diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 7a7aeb014674..87bfe1678309 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -575,6 +575,11 @@ npxinit(control) savecrit = critical_enter(); npxsave(&dummy); stop_emulating(); +#ifdef CPU_ENABLE_SSE + /* XXX npxsave() doesn't actually initialize the fpu in the SSE case. */ + if (cpu_fxsr) + fninit(); +#endif fldcw(&control); if (PCPU_GET(curpcb) != NULL) fpusave(&PCPU_GET(curpcb)->pcb_save); diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c index 7a7aeb014674..87bfe1678309 100644 --- a/sys/amd64/isa/npx.c +++ b/sys/amd64/isa/npx.c @@ -575,6 +575,11 @@ npxinit(control) savecrit = critical_enter(); npxsave(&dummy); stop_emulating(); +#ifdef CPU_ENABLE_SSE + /* XXX npxsave() doesn't actually initialize the fpu in the SSE case. */ + if (cpu_fxsr) + fninit(); +#endif fldcw(&control); if (PCPU_GET(curpcb) != NULL) fpusave(&PCPU_GET(curpcb)->pcb_save); diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 7a7aeb014674..87bfe1678309 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -575,6 +575,11 @@ npxinit(control) savecrit = critical_enter(); npxsave(&dummy); stop_emulating(); +#ifdef CPU_ENABLE_SSE + /* XXX npxsave() doesn't actually initialize the fpu in the SSE case. */ + if (cpu_fxsr) + fninit(); +#endif fldcw(&control); if (PCPU_GET(curpcb) != NULL) fpusave(&PCPU_GET(curpcb)->pcb_save);