Page MenuHomeFreeBSD

Various fixes to TLS for MIPS.
Needs ReviewPublic

Authored by jhb on Fri, May 22, 4:09 PM.


  • Clear the current thread's TLS pointer on exec. Previously the TLS pointer (and register) remain unchanged.
  • Explicitly clear the TLS pointer when new threads are created.
  • Make md_tls_tcb_offset per-process instead of per-thread.

    The layout of the TLS and TCB are identical for all threads in a process, it is only the TLS pointer values themselves that vary by thread. This also makes setting md_tls_tcb_offset in cpu_set_user_tls() redundant with the setting in exec_setregs(), so only set it in exec_setregs().
Test Plan
  • booted mips64 in qemu. ntpd is multi-threaded so was a good test of this (it crashed for some earlier verions when I had a bug)

Diff Detail

Lint OK
No Unit Test Coverage
Build Status
Buildable 31236
Build 28885: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Fri, May 22, 4:09 PM
jhb created this revision.

Note though that qemu doesn't advertise UserLocal support, so my testing didn't verify the changes in cpu_switch() in particular.