Page MenuHomeFreeBSD

x86: Copy the FPU/XSAVE state from the creating thread to new threads.
ClosedPublic

Authored by jhb on Mar 10 2021, 10:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 9:33 PM
Unknown Object (File)
Fri, Dec 6, 11:34 AM
Unknown Object (File)
Thu, Dec 5, 10:29 PM
Unknown Object (File)
Nov 19 2024, 3:16 PM
Unknown Object (File)
Nov 17 2024, 6:02 AM
Unknown Object (File)
Nov 16 2024, 6:55 AM
Unknown Object (File)
Nov 16 2024, 6:40 AM
Unknown Object (File)
Nov 16 2024, 3:50 AM
Subscribers

Details

Summary

POSIX states that new threads created via pthread_create() should
inherit the "floating point environment" from the creating thread.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I tested this on amd64 using kib@'s test program from D29024.

sys/i386/i386/vm_machdep.c
434

Why not call npxexit() there, same as for amd64?

466

This should be fine but unrelated?

sys/i386/i386/vm_machdep.c
434

Why not call npxexit() there, same as for amd64?

This matches cpu_fork() for i386 which does not use npxexit(). If we'd rather fix i386 to use npxexit() can I throw that into this series.

466

This should be fine but unrelated?

It's just part of the 'update pcb before copy logic' which now matches cpu_fork(). Since I had to add the FPU save, I figured this should mirror cpu_fork() at the same time.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 12 2021, 5:50 PM
This revision was automatically updated to reflect the committed changes.