summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Souza <luiz@netgate.com>2018-02-21 14:26:50 -0300
committerLuiz Souza <luiz@netgate.com>2018-02-21 14:26:50 -0300
commitffca621f122bcca1fcedc7db2747d2537e749ae4 (patch)
treed4d71ae804a4c32452ecf8cf32b7282ce771d080
parentc1ee180537f04875eccd8e9b3d630b73ad654b14 (diff)
downloadFreeBSD-src-ffca621f122bcca1fcedc7db2747d2537e749ae4.zip
FreeBSD-src-ffca621f122bcca1fcedc7db2747d2537e749ae4.tar.gz
Revert "MFC r325270:"
This reverts commit c15b1102756fd1613686a6d232b018ae7b0616d5.
-rw-r--r--sys/amd64/amd64/fpu.c1
-rw-r--r--sys/amd64/amd64/machdep.c6
-rw-r--r--sys/i386/i386/machdep.c7
-rw-r--r--sys/i386/isa/npx.c2
4 files changed, 9 insertions, 7 deletions
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c
index 540966b..4c70e88 100644
--- a/sys/amd64/amd64/fpu.c
+++ b/sys/amd64/amd64/fpu.c
@@ -806,7 +806,6 @@ fpusetregs(struct thread *td, struct savefpu *addr, char *xfpustate,
struct pcb *pcb;
int error;
- addr->sv_env.en_mxcsr &= cpu_mxcsr_mask;
pcb = td->td_pcb;
critical_enter();
if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) {
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index a0d34f0..96d8c63 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -2248,6 +2248,7 @@ static int
set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate,
size_t xfpustate_len)
{
+ struct savefpu *fpstate;
int error;
if (mcp->mc_fpformat == _MC_FPFMT_NODEV)
@@ -2260,8 +2261,9 @@ set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate,
error = 0;
} else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU ||
mcp->mc_ownedfp == _MC_FPOWNED_PCB) {
- error = fpusetregs(td, (struct savefpu *)&mcp->mc_fpstate,
- xfpustate, xfpustate_len);
+ fpstate = (struct savefpu *)&mcp->mc_fpstate;
+ fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask;
+ error = fpusetregs(td, fpstate, xfpustate, xfpustate_len);
} else
return (EINVAL);
return (error);
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index aab7a3e..9968714 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -3138,6 +3138,7 @@ static int
set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate,
size_t xfpustate_len)
{
+ union savefpu *fpstate;
int error;
if (mcp->mc_fpformat == _MC_FPFMT_NODEV)
@@ -3151,8 +3152,10 @@ set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate,
error = 0;
} else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU ||
mcp->mc_ownedfp == _MC_FPOWNED_PCB) {
- error = npxsetregs(td, (union savefpu *)&mcp->mc_fpstate,
- xfpustate, xfpustate_len);
+ fpstate = (union savefpu *)&mcp->mc_fpstate;
+ if (cpu_fxsr)
+ fpstate->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask;
+ error = npxsetregs(td, fpstate, xfpustate, xfpustate_len);
} else
return (EINVAL);
return (error);
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 2f15cb8..5ef616b2 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -1053,8 +1053,6 @@ npxsetregs(struct thread *td, union savefpu *addr, char *xfpustate,
if (!hw_float)
return (ENXIO);
- if (cpu_fxsr)
- addr->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask;
pcb = td->td_pcb;
critical_enter();
if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) {
OpenPOWER on IntegriCloud