charm
charm copied to clipboard
Use Linux FSGSBASE support for TLSglobals privatization
Linux v5.9 has new support for the FSGSBASE family of instructions which allow reading and writing the TLS segment pointer that we swap in TLSglobals privatization. We currently depend on support for the compiler option "-mno-tls-direct-seg-refs" to disable compiler optimizations that avoid looking up through that pointer every thread_local variable reference. Using these new instructions would improve the portability of TLSglobals.
[1] https://kernel.org/doc/html/next/x86/x86_64/fsgs.html [2] https://www.phoronix.com/scan.php?page=news_item&px=FSGSBASE-For-Linux-5.9