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)
Mar 16 2024, 10:15 PM
Unknown Object (File)
Mar 16 2024, 10:15 PM
Unknown Object (File)
Mar 16 2024, 10:15 PM
Unknown Object (File)
Mar 16 2024, 9:59 PM
Unknown Object (File)
Feb 15 2024, 5:57 PM
Unknown Object (File)
Feb 6 2024, 1:23 PM
Unknown Object (File)
Dec 20 2023, 3:08 AM
Unknown Object (File)
Dec 16 2023, 12:37 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.