[Glibc-bsd-commits] r5952 - trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64
aurel32 at alioth.debian.org
aurel32 at alioth.debian.org
Sun Mar 20 00:13:31 UTC 2016
Author: aurel32
Date: 2016-03-20 00:13:31 +0000 (Sun, 20 Mar 2016)
New Revision: 5952
Modified:
trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64/tcb-offsets.sym
trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64/tls.h
Log:
Merge from upstream:
commit f3dcae82d54e5097e18e1d6ef4ff55c2ea4e621e
Author: H.J. Lu <hjl.tools at gmail.com>
Date: Tue Aug 25 04:33:54 2015 -0700
Save and restore vector registers in x86-64 ld.so
This patch adds SSE, AVX and AVX512 versions of _dl_runtime_resolve
and _dl_runtime_profile, which save and restore the first 8 vector
registers used for parameter passing. elf_machine_runtime_setup
selects the proper _dl_runtime_resolve or _dl_runtime_profile based
on _dl_x86_cpu_features. It avoids race condition caused by
FOREIGN_CALL macros, which are only used for x86-64.
Performance impact of saving and restoring 8 vector registers are
negligible on Nehalem, Sandy Bridge, Ivy Bridge and Haswell when
ld.so is optimized with SSE2.
Modified: trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64/tcb-offsets.sym
===================================================================
--- trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64/tcb-offsets.sym 2016-03-20 00:01:37 UTC (rev 5951)
+++ trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64/tcb-offsets.sym 2016-03-20 00:13:31 UTC (rev 5952)
@@ -15,7 +15,6 @@
#ifndef __ASSUME_PRIVATE_FUTEX
PRIVATE_FUTEX offsetof (tcbhead_t, private_futex)
#endif
-RTLD_SAVESPACE_SSE offsetof (tcbhead_t, rtld_savespace_sse)
-- Not strictly offsets, but these values are also used in the TCB.
TCB_CANCELSTATE_BITMASK CANCELSTATE_BITMASK
Modified: trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64/tls.h
===================================================================
--- trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64/tls.h 2016-03-20 00:01:37 UTC (rev 5951)
+++ trunk/glibc-ports-2.23/fbtl/sysdeps/x86_64/tls.h 2016-03-20 00:13:31 UTC (rev 5952)
@@ -67,14 +67,15 @@
# else
int __unused1;
# endif
- int rtld_must_xmm_save;
+ int __glibc_unused1;
/* Reservation of some values for the TM ABI. */
void *__private_tm[4];
/* GCC split stack support. */
void *__private_ss;
long int __unused2;
- /* Have space for the post-AVX register size. */
- __128bits rtld_savespace_sse[8][4] __attribute__ ((aligned (32)));
+ /* Must be kept even if it is no longer used by glibc since programs,
+ like AddressSanitizer, depend on the size of tcbhead_t. */
+ __128bits __glibc_unused2[8][4] __attribute__ ((aligned (32)));
void *__padding[8];
} tcbhead_t;
@@ -383,41 +384,6 @@
# define THREAD_GSCOPE_WAIT() \
GL(dl_wait_lookup_done) ()
-
-# ifdef SHARED
-/* Defined in dl-trampoline.S. */
-extern void _dl_x86_64_save_sse (void);
-extern void _dl_x86_64_restore_sse (void);
-
-# define RTLD_CHECK_FOREIGN_CALL \
- (THREAD_GETMEM (THREAD_SELF, header.rtld_must_xmm_save) != 0)
-
-/* NB: Don't use the xchg operation because that would imply a lock
- prefix which is expensive and unnecessary. The cache line is also
- not contested at all. */
-# define RTLD_ENABLE_FOREIGN_CALL \
- int old_rtld_must_xmm_save = THREAD_GETMEM (THREAD_SELF, \
- header.rtld_must_xmm_save); \
- THREAD_SETMEM (THREAD_SELF, header.rtld_must_xmm_save, 1)
-
-# define RTLD_PREPARE_FOREIGN_CALL \
- do if (THREAD_GETMEM (THREAD_SELF, header.rtld_must_xmm_save)) \
- { \
- _dl_x86_64_save_sse (); \
- THREAD_SETMEM (THREAD_SELF, header.rtld_must_xmm_save, 0); \
- } \
- while (0)
-
-# define RTLD_FINALIZE_FOREIGN_CALL \
- do { \
- if (THREAD_GETMEM (THREAD_SELF, header.rtld_must_xmm_save) == 0) \
- _dl_x86_64_restore_sse (); \
- THREAD_SETMEM (THREAD_SELF, header.rtld_must_xmm_save, \
- old_rtld_must_xmm_save); \
- } while (0)
-# endif
-
-
#endif /* __ASSEMBLER__ */
#endif /* tls.h */
More information about the Glibc-bsd-commits
mailing list