Mercurial > illumos > git > illumos-joyent
changeset 25226:67c78ce4f29a
[illumos-gate merge]
commit 948cceb01d0173f5a732ef880dddcadff2204c12
12968 curthread swtch-ing while the kernel is using the FPU
author | Jerry Jelinek <jerry.jelinek@joyent.com> |
---|---|
date | Tue, 21 Jul 2020 11:47:10 +0000 |
parents | e3bb7d137217 (current diff) c159faf41709 (diff) |
children | 7459e8d6f008 |
files | usr/src/uts/intel/ia32/os/fpu.c |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/intel/ia32/os/fpu.c Mon Jul 20 11:38:57 2020 +0000 +++ b/usr/src/uts/intel/ia32/os/fpu.c Tue Jul 21 11:47:10 2020 +0000 @@ -1420,14 +1420,15 @@ if ((flags & KFPU_NO_STATE) == 0) { /* - * Disable preemption so that we don't swtch after removing - * the context handlers but before we turn off T_KFPU. + * Disable preemption so that we don't swtch in the middle of + * removing the context handlers. We turn off T_KFPU first, + * since it is possible to voluntarily swtch during kmem_free + * while removing the context handlers. */ kpreempt_disable(); + curthread->t_flag &= ~T_KFPU; removectx(curthread, kfpu, kernel_fpu_ctx_save, kernel_fpu_ctx_restore, NULL, NULL, NULL, NULL); - - curthread->t_flag &= ~T_KFPU; kpreempt_enable(); if (kfpu != NULL) {