aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2010-12-12 16:16:39 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2010-12-12 16:16:39 +0000
commit60c7c84e85e8c6cbaf6b172aa8bcbf2eb958aac8 (patch)
tree8dd3f3212f7aad11833b6a27f196e3a96f661f84 /sys
parent552c039da95ce27389bb26a517f4e2dcb748a79b (diff)
downloadsrc-60c7c84e85e8c6cbaf6b172aa8bcbf2eb958aac8.tar.gz
src-60c7c84e85e8c6cbaf6b172aa8bcbf2eb958aac8.zip
In fpudna()/npxdna(), mark FPU context initialized and optionally
mark user FPU context initialized, if current context is user context. It was reversed in r215865, by inadequate change of this code fragment to a call to fpuuserinited()/npxuserinited(). The issue is only relevant for in-kernel users of FPU. Reported by: Jan Henrik Sylvester <me janh de>, Mike Tancsa <mike sentex net> Tested by: Mike Tancsa MFC after: 3 days
Notes
Notes: svn path=/head/; revision=216394
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/fpu.c4
-rw-r--r--sys/i386/isa/npx.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c
index 482b5daa362e..1b493b4d6623 100644
--- a/sys/amd64/amd64/fpu.c
+++ b/sys/amd64/amd64/fpu.c
@@ -426,7 +426,9 @@ fpudna(void)
fxrstor(&fpu_initialstate);
if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__)
fldcw(pcb->pcb_initial_fpucw);
- fpuuserinited(curthread);
+ pcb->pcb_flags |= PCB_FPUINITDONE;
+ if (PCB_USER_FPU(pcb))
+ pcb->pcb_flags |= PCB_USERFPUINITDONE;
} else
fxrstor(pcb->pcb_save);
critical_exit();
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 9ec5d25f57bc..f314e442a789 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -684,7 +684,9 @@ npxdna(void)
fpurstor(&npx_initialstate);
if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__)
fldcw(pcb->pcb_initial_npxcw);
- npxuserinited(curthread);
+ pcb->pcb_flags |= PCB_NPXINITDONE;
+ if (PCB_USER_FPU(pcb))
+ pcb->pcb_flags |= PCB_NPXUSERINITDONE;
} else {
/*
* The following fpurstor() may cause an IRQ13 when the