]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix for mis-interpretation of PCB_KERNFPU.
authorKonstantin Belousov <kib@FreeBSD.org>
Wed, 14 Oct 2020 23:01:41 +0000 (23:01 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Wed, 14 Oct 2020 23:01:41 +0000 (23:01 +0000)
commite406235000fea46ac447fca91e15b061e8e8ca9d
treea2e04e157b745378bca9d4136c5007cfb04a3ab1
parentd3ba71b2b1abc77d1625d693191d7f6d2fcfc5cb
Fix for mis-interpretation of PCB_KERNFPU.

RIght now PCB_KERNFPU is used both as indication that kernel prepared
hardware FPU context to use and that the thread is fpu-kern
thread.  This also breaks fpu_kern_enter(FPU_KERN_NOCTX), since
fpu_kern_leave() then clears PCB_KERNFPU.

Introduce new flag PCB_KERNFPU_THR which indicates that the thread is
fpu-kern.  Do not clear PCB_KERNFPU if fpu-kern thread leaves noctx
fpu region.

Reported and tested by: jhb (amd64)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25511
sys/amd64/amd64/fpu.c
sys/amd64/include/pcb.h
sys/i386/i386/npx.c
sys/i386/include/pcb.h