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
F102707378: D29204.diff
Sat, Nov 16, 3:50 AM
Unknown Object (File)
Tue, Nov 5, 3:45 PM
Unknown Object (File)
Sun, Oct 20, 6:24 PM
Unknown Object (File)
Fri, Oct 18, 9:20 PM
Unknown Object (File)
Oct 15 2024, 7:36 AM
Unknown Object (File)
Oct 14 2024, 12:45 PM
Unknown Object (File)
Oct 10 2024, 11:15 PM
Unknown Object (File)
Oct 4 2024, 10:59 PM
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.