glibc:hjl/pr19583

Last commit made on 2016-03-23
Get this branch:
git clone -b hjl/pr19583 https://git.launchpad.net/glibc

Branch merges

Branch information

Name:
hjl/pr19583
Repository:
lp:glibc

Recent commits

327aadf... by "H.J. Lu" <email address hidden>

[x86] Add a feature bit: Fast_Unaligned_Copy

On AMD processors, memcpy optimized with unaligned SSE load is
slower than emcpy optimized with aligned SSSE3 while other string
functions are faster with unaligned SSE load. A feature bit,
Fast_Unaligned_Copy, is added to select memcpy optimized with
unaligned SSE load.

 [BZ #19583]
 * sysdeps/x86/cpu-features.c (init_cpu_features): Set
 Fast_Unaligned_Copy with Fast_Unaligned_Load for Intel
 processors. Set Fast_Copy_Backward for AMD Excavator
 processors.
 * sysdeps/x86/cpu-features.h (bit_arch_Fast_Unaligned_Copy):
 New.
 (index_arch_Fast_Unaligned_Copy): Likewise.
 * sysdeps/x86_64/multiarch/memcpy.S (__new_memcpy): Check
 Fast_Unaligned_Copy instead of Fast_Unaligned_Load.

7a25d6a... by Nick Alcock <email address hidden>

x86, pthread_cond_*wait: Do not depend on %eax not being clobbered

The x86-specific versions of both pthread_cond_wait and
pthread_cond_timedwait have (in their fall-back-to-futex-wait slow
paths) calls to __pthread_mutex_cond_lock_adjust followed by
__pthread_mutex_unlock_usercnt, which load the parameters before the
first call but then assume that the first parameter, in %eax, will
survive unaffected. This happens to have been true before now, but %eax
is a call-clobbered register, and this assumption is not safe: it could
change at any time, at GCC's whim, and indeed the stack-protector canary
checking code clobbers %eax while checking that the canary is
uncorrupted.

So reload %eax before calling __pthread_mutex_unlock_usercnt. (Do this
unconditionally, even when stack-protection is not in use, because it's
the right thing to do, it's a slow path, and anything else is dicing
with death.)

 * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S: Reload
 call-clobbered %eax on retry path.
 * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S: Likewise.

3c9a4cd... by "H.J. Lu" <email address hidden>

Don't set %rcx twice before "rep movsb"

 * sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S (MEMCPY):
 Don't set %rcx twice before "rep movsb".

f781a9e... by "H.J. Lu" <email address hidden>

Set index_arch_AVX_Fast_Unaligned_Load only for Intel processors

Since only Intel processors with AVX2 have fast unaligned load, we
should set index_arch_AVX_Fast_Unaligned_Load only for Intel processors.

Move AVX, AVX2, AVX512, FMA and FMA4 detection into get_common_indeces
and call get_common_indeces for other processors.

Add CPU_FEATURES_CPU_P and CPU_FEATURES_ARCH_P to aoid loading
GLRO(dl_x86_cpu_features) in cpu-features.c.

 [BZ #19583]
 * sysdeps/x86/cpu-features.c (get_common_indeces): Remove
 inline. Check family before setting family, model and
 extended_model. Set AVX, AVX2, AVX512, FMA and FMA4 usable
 bits here.
 (init_cpu_features): Replace HAS_CPU_FEATURE and
 HAS_ARCH_FEATURE with CPU_FEATURES_CPU_P and
 CPU_FEATURES_ARCH_P. Set index_arch_AVX_Fast_Unaligned_Load
 for Intel processors with usable AVX2. Call get_common_indeces
 for other processors with family == NULL.
 * sysdeps/x86/cpu-features.h (CPU_FEATURES_CPU_P): New macro.
 (CPU_FEATURES_ARCH_P): Likewise.
 (HAS_CPU_FEATURE): Use CPU_FEATURES_CPU_P.
 (HAS_ARCH_FEATURE): Use CPU_FEATURES_ARCH_P.

b87e413... by Samuel thibault

Fix malloc threaded tests link on non-Linux

 * malloc/Makefile ($(objpfx)tst-malloc-backtrace,
 $(objpfx)tst-malloc-thread-exit, $(objpfx)tst-malloc-thread-fail): Use
 $(shared-thread-library) instead of hardcoding the path to libpthread.

37ad347... by Joseph Myers <email address hidden>

Remove __ASSUME_GETDENTS64_SYSCALL.

This patch removes the __ASSUME_GETDENTS64_SYSCALL macro, as its
definition is constant given the new kernel version requirements (and
was constant anyway before those requirements except for MIPS n32).

Note that the "#ifdef __NR_getdents64" conditional *is* still needed,
because MIPS n64 only has the getdents syscall (being a 64-bit ABI,
that syscall is 64-bit; the difference between the two on 64-bit
architectures is where d_type goes). If MIPS n64 were to gain the
getdents64 syscall and we wanted to use it conditionally on the kernel
version at runtime we'd have to revert this patch, but I think that's
unlikely (and in any case, we could follow the simpler approach of
undefining __NR_getdents64 if the syscall can't be assumed, just like
we do for accept4 / recvmmsg / sendmmsg syscalls on architectures
where socketcall support came first).

Most of the getdents.c changes are reindentation.

Tested for x86_64 and x86 that installed stripped shared libraries are
unchanged by the patch.

 * sysdeps/unix/sysv/linux/kernel-features.h
 (__ASSUME_GETDENTS64_SYSCALL): Remove macro.
 * sysdeps/unix/sysv/linux/getdents.c
 [!__ASSUME_GETDENTS64_SYSCALL]: Remove conditional code.
 [!have_no_getdents64_defined]: Likewise.
 (__GETDENTS): Remove __have_no_getdents64 conditional.

238d60a... by Joseph Myers <email address hidden>

Remove __ASSUME_SIGNALFD4.

Current Linux kernel version requirements mean the signalfd4 syscall
can always be assumed to be available. This patch removes
__ASSUME_SIGNALFD4 and associated conditionals.

Tested for x86_64 and x86 that installed stripped shared libraries are
unchanged by the patch.

 * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_SIGNALFD4):
 Remove macro.
 * sysdeps/unix/sysv/linux/signalfd.c: Do not include
 <kernel-features.h>.
 (signalfd) [__NR_signalfd4]: Make code unconditional.
 (signalfd) [!__ASSUME_SIGNALFD4]: Remove conditional code.

67b2337... by Adhemerval Zanella <email address hidden>

posix: Fix posix_spawn implict check style

This patch fixes the implicit check style add in 2a69f853c for the
general convention one.

Checked on x86_64.

 * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Fix implict checks
 style.

893e371... by "H.J. Lu" <email address hidden>

Use JUMPTARGET in x86-64 pthread

When PLT may be used, JUMPTARGET should be used instead calling the
function directly.

 * sysdeps/unix/sysv/linux/x86_64/cancellation.S
 (__pthread_enable_asynccancel): Use JUMPTARGET to call
 __pthread_unwind.
 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
 (__condvar_cleanup2): Use JUMPTARGET to call _Unwind_Resume.
 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
 (__condvar_cleanup1): Likewise.

a4cea54... by Mike Frysinger

localedata: standardize copyright/license information [BZ #11213]

Use the language from the FSF in all locale files to disclaim any
license/copyright on locale data.

See https://sourceware.org/ml/libc-locales/2013-q1/msg00048.html