Remove lazy FPU switch support from amd64.

It is incompatible with some future features.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2019-06-08 16:03:34 +00:00
parent 27d72fe14a
commit 99b81dcb9e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348802

View File

@ -154,11 +154,6 @@ static void fpu_clean_state(void);
SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware");
int lazy_fpu_switch = 0;
SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
&lazy_fpu_switch, 0,
"Lazily load FPU context after context switch");
int use_xsave; /* non-static for cpu_switch.S */
uint64_t xsave_mask; /* the same */
static uma_zone_t fpu_save_area_zone;
@ -269,7 +264,6 @@ fpuinit_bsp1(void)
uint64_t xsave_mask_user;
bool old_wp;
TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch);
if (!use_xsave)
return;
cpuid_count(0xd, 0x0, cp);
@ -774,8 +768,7 @@ void
fpu_activate_sw(struct thread *td)
{
if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 ||
!PCB_USER_FPU(td->td_pcb)) {
if ((td->td_pflags & TDP_KTHREAD) != 0 || !PCB_USER_FPU(td->td_pcb)) {
PCPU_SET(fpcurthread, NULL);
start_emulating();
} else if (PCPU_GET(fpcurthread) != td) {