glibc/sysdeps
H.J. Lu f3dcae82d5 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.

	[BZ #15128]
	* sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
	ifuncmain8.
	(modules-names): Add ifuncmod8.
	($(objpfx)ifuncmain8): New rule.
	* sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
	<cpuid.h>.
	(elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
	_dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
	_dl_runtime_profile_sse, _dl_runtime_profile_avx, or
	_dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
	* sysdeps/x86_64/dl-trampoline.S: Rewrite.
	* sysdeps/x86_64/dl-trampoline.h: Likewise.
	* sysdeps/x86_64/ifuncmain8.c: New file.
	* sysdeps/x86_64/ifuncmod8.c: Likewise.
	* sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
	Removed.
	* sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
	(tcbhead_t): Change rtld_must_xmm_save to __glibc_unused1.
	Change rtld_savespace_sse to __glibc_unused2.
	(RTLD_CHECK_FOREIGN_CALL): Removed.
	(RTLD_ENABLE_FOREIGN_CALL): Likewise.
	(RTLD_PREPARE_FOREIGN_CALL): Likewise.
	(RTLD_FINALIZE_FOREIGN_CALL): Likewise.
2015-08-25 04:34:13 -07:00
..
aarch64 2015-08-24 Wilco Dijkstra <wdijkstr@arm.com> 2015-08-24 14:49:46 +01:00
alpha alpha: Update libm-test-ulps 2015-05-19 09:43:54 -07:00
arm Fix BZ #18084 -- backtrace (..., 0) dumps core on x86. 2015-08-15 11:42:43 -07:00
generic Factor file identity rules out of generic rtld code. 2015-07-14 13:15:26 -07:00
gnu hurd: fix unwind-resume.c build 2015-02-08 18:46:00 +01:00
hppa hppa: start.S: rework references to fix PIE TEXTRELs [BZ #18421] 2015-08-18 02:37:17 -04:00
i386 Remove the unused IFUNC files 2015-08-20 12:47:20 -07:00
ia64 ia64: atomic.h: fix atomic_exchange_and_add 64bit handling 2015-07-28 02:30:15 -04:00
ieee754 Fix uninitialized variable use in ldbl-128ibm nearbyintl. 2015-08-20 17:28:09 +00:00
init_array NPTL: Initializer for .init_array-only configurations. 2015-02-13 13:19:11 -08:00
m68k Fix BZ #18084 -- backtrace (..., 0) dumps core on x86. 2015-08-15 11:42:43 -07:00
mach PLT avoidance for _exit in rtld. 2015-07-09 15:25:47 -07:00
microblaze Fix BZ #18084 -- backtrace (..., 0) dumps core on x86. 2015-08-15 11:42:43 -07:00
mips Fix MIPS -Wundef warnings for __mips_isa_rev. 2015-08-18 21:52:22 +00:00
nacl NaCl: Remove bogus O_SHLOCK, O_EXLOCK definitions. 2015-07-24 12:31:23 -07:00
nios2 Fixes extern protected data handling testcases elf/tst-protected1a 2015-07-26 05:27:18 -07:00
nptl Add and use new glibc-internal futex API. 2015-07-10 13:47:09 +02:00
posix Fix BZ #18086 -- nice resets errno to 0. 2015-08-11 23:40:00 -07:00
powerpc powerpc: Fix memchr for powerpc32. 2015-08-21 17:06:06 -03:00
pthread Use unsigned types for counters in AIO code. 2015-06-24 17:43:32 -07:00
s390 Fix BZ #18084 -- backtrace (..., 0) dumps core on x86. 2015-08-15 11:42:43 -07:00
sh Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
sparc Fix BZ #18084 -- backtrace (..., 0) dumps core on x86. 2015-08-15 11:42:43 -07:00
tile tilepro: fix warnings in sysdeps/tile/tilepro/bits/atomic.h 2015-08-04 12:07:53 -04:00
unix Remove __ASSUME_IPC64 2015-08-24 10:53:49 +02:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
x86 Move x86_64 init-arch.h to sysdeps/x86/init-arch.h 2015-08-20 04:29:23 -07:00
x86_64 Save and restore vector registers in x86-64 ld.so 2015-08-25 04:34:13 -07:00