about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* nptl: Move sem_close, sem_open into libcFlorian Weimer2021-05-0564-77/+169
| | | | | | | | | | | The symbols were moved using move-symbol-to-libc.py. Both functions are moved at the same time because they depend on internal functions in sysdeps/pthread/sem_routines.c, which are moved in this commit as well. Additional hidden prototypes are required to avoid check-localplt failures. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move sem_clockwait into libcFlorian Weimer2021-05-0561-29/+91
| | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. A new placeholder version is added at version GLIBC_2.30, to preserve that version in libpthread.so.0. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Consolidate async cancel enable/disable implementation in libcFlorian Weimer2021-05-055-72/+12
| | | | | | | | | | | | | | Previously, the source file nptl/cancellation.c was compiled multiple times, for libc, libpthread, librt. This commit switches to a single implementation, with new __pthread_enable_asynccancel@@GLIBC_PRIVATE, __pthread_disable_asynccancel@@GLIBC_PRIVATE exports. The almost-unused CANCEL_ASYNC and CANCEL_RESET macros are replaced by LIBC_CANCEL_ASYNC and LIBC_CANCEL_ASYNC macros. They call the __pthread_* functions unconditionally now. The macros are still needed because shared code uses them; Hurd has different definitions. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_testcancel into libcFlorian Weimer2021-05-0561-29/+64
| | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. A temporary __pthread_testcancel@@GLIBC_PRIVATE export is created because it is needed by the semaphore implementation. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf, nptl: Initialize static TLS directly in ld.soFlorian Weimer2021-05-051-0/+19
| | | | | | | | | | The stack list is available in ld.so since commit 1daccf403b1bd86370eb94edca794dc106d02039 ("nptl: Move stack list variables into _rtld_global"), so it's possible to walk the stack list directly in ld.so and perform the initialization there. This eliminates an unprotected function pointer from _rtld_global and reduces the libpthread initialization code.
* x86: Optimize memchr-evex.SNoah Goldstein2021-05-031-225/+322
| | | | | | | | | | | | No bug. This commit optimizes memchr-evex.S. The optimizations include replacing some branches with cmovcc, avoiding some branches entirely in the less_4x_vec case, making the page cross logic less strict, saving some ALU in the alignment process, and most importantly increasing ILP in the 4x loop. test-memchr, test-rawmemchr, and test-wmemchr are all passing. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* x86: Optimize memchr-avx2.SNoah Goldstein2021-05-031-178/+247
| | | | | | | | | | | No bug. This commit optimizes memchr-avx2.S. The optimizations include replacing some branches with cmovcc, avoiding some branches entirely in the less_4x_vec case, making the page cross logic less strict, asaving a few instructions the in loop return loop. test-memchr, test-rawmemchr, and test-wmemchr are all passing. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* linux: use __fd_to_filename helper function instead of snprintf.Érico Nogueira2021-05-032-16/+7
| | | | | Change made to fchmodat and fexecve. There are tests using xasprintf instead of this helper as well, but this commit doesn't touch them.
* linux: Add execveat system call wrapperAlexandra Hájková2021-05-0334-0/+65
| | | | | | | | | | | It operates similar to execve and it is is already used to implement fexecve without requiring /proc to be mounted. However, different than fexecve, if the syscall is not supported by the kernel an error is returned instead of trying a fallback. Checked on x86_64-linux-gnu and powerpc64le-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* x86: Set rep_movsb_threshold to 2112 on processors with FSRMH.J. Lu2021-05-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The glibc memcpy benchmark on Intel Core i7-1065G7 (Ice Lake) showed that REP MOVSB became faster after 2112 bytes: Vector Move REP MOVSB length=2112, align1=0, align2=0: 24.20 24.40 length=2112, align1=1, align2=0: 26.07 23.13 length=2112, align1=0, align2=1: 27.18 28.13 length=2112, align1=1, align2=1: 26.23 25.16 length=2176, align1=0, align2=0: 23.18 22.52 length=2176, align1=2, align2=0: 25.45 22.52 length=2176, align1=0, align2=2: 27.14 27.82 length=2176, align1=2, align2=2: 22.73 25.56 length=2240, align1=0, align2=0: 24.62 24.25 length=2240, align1=3, align2=0: 29.77 27.15 length=2240, align1=0, align2=3: 35.55 29.93 length=2240, align1=3, align2=3: 34.49 25.15 length=2304, align1=0, align2=0: 34.75 26.64 length=2304, align1=4, align2=0: 32.09 22.63 length=2304, align1=0, align2=4: 28.43 31.24 Use REP MOVSB for data size > 2112 bytes in memcpy on processors with fast short REP MOVSB (FSRM). * sysdeps/x86/dl-cacheinfo.h (dl_init_cacheinfo): Set rep_movsb_threshold to 2112 on processors with fast short REP MOVSB (FSRM).
* nptl: Move pthread_yield into libc, as a compatibility symbolFlorian Weimer2021-05-0362-33/+39
| | | | | | | | | | | | | And deprecate it in <pthread.h>, redirecting it to sched_yield for the time being. The symbol was moved using scripts/move-symbol-to-libc.py. No GLIBC_2.34 symbol version is added because of the compatibility symbol status. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlockattr_setpshared into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlockattr_setkind_np into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlockattr_init into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlockattr_getpshared into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlockattr_getkind_np into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlockattr_destroy into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlock_trywrlock into libcFlorian Weimer2021-05-0362-63/+96
| | | | | | | | | | | And __pthread_rwlock_trywrlock as a compatibility symbol. Remove the unused __libc_rwlock_trywrlock macro. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlock_tryrdlock into libcFlorian Weimer2021-05-0362-63/+96
| | | | | | | | | | | And __pthread_rwlock_tryrdlock as a compatibility symbol. Remove the unused __libc_rwlock_tryrdlock macro. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlock_timedwrlock into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlock_timedrdlock into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlock_init into libcFlorian Weimer2021-05-0362-67/+98
| | | | | | | | | | | And __pthread_rwlock_init as a compatibility symbol. __libc_rwlock_init is changed to call __pthread_rwlock_init directly. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlock_destroy into libcFlorian Weimer2021-05-0362-66/+97
| | | | | | | | | | | | And __pthread_rwlock_destroy as a compatibility symbol. rwlocks do not need finalization, so change __libc_rwlock_fini to do nothing. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlock_clockwrlock into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_rwlock_clockrdlock into libcFlorian Weimer2021-05-0361-29/+64
| | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move tss_set into libcFlorian Weimer2021-05-0363-64/+76
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. __pthread_setspecific@@GLIBC_2.34 is no longer needed after the move, so it is removed with this commit, too. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move tss_get into libcFlorian Weimer2021-05-0363-63/+76
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. __pthread_getspecific@@GLIBC_2.34 is no longer needed after the move, so it is removed with this commit, too. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move tss_delete into libcFlorian Weimer2021-05-0363-31/+76
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. __pthread_key_delete@@GLIBC_PRIVATE is no longer needed after that, so it is removed as well. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move tss_create into libcFlorian Weimer2021-05-0363-31/+76
| | | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. __pthread_key_create@@GLIBC_2.34 is no longer needed by glibc itself with this change, but __pthread_key_create is used by libstdc++, so it still has to be exported as a public symbol. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move thrd_exit into libcFlorian Weimer2021-05-0363-31/+76
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_exit@@GLIBC_PRIVATE symbol is no longer needed after this change, so remove it. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move mtx_unlock into libcFlorian Weimer2021-05-0363-31/+75
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. __pthread_mutex_unlock@GLIBC_2.34 is not removed in this commit because it is still used from nptl/nptl-init.c. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move mtx_trylock into libcFlorian Weimer2021-05-0363-63/+76
| | | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_mutex_trylock@@GLIBC_2.34 symbol version is no longer needed because the call is now internal to libc, so remove it with this commit. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move mtx_timedlock into libcFlorian Weimer2021-05-0364-38/+80
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_mutex_timedlock@@GLIBC_PRIVATE export is no longer needed, so it is removed with this commit. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move mtx_lock into libcFlorian Weimer2021-05-0363-31/+76
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. __pthread_mutex_lock@GLIBC_2.34 is not removed in this commit because it is still used from nptl/nptl-init.c. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move mtx_init into libcFlorian Weimer2021-05-0364-135/+76
| | | | | | | | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The calls to __pthread_mutex_init, __pthread_mutexattr_init, __pthread_mutexattr_settype are now private and no longer need to be exported. This allows the removal of the newly added GLIBC_2.34 symbol versions for those functions. Also clean up some weak declarations in <libc-lockP.h> for these functions. They are not needed and potentially incorrect for static linking of mtx_init. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move mtx_destroy into libcFlorian Weimer2021-05-0363-63/+76
| | | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_mutex_destroy@@GLIBC_2.34 symbol is no longer neded because this commit makes __pthread_mutex_destroy@GLIBC_2.0 a compatibility symbol, so remove the new symbol version. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move cnd_wait into libcFlorian Weimer2021-05-0363-31/+75
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_cond_wait@@GLIBC_PRIVATE symbol is no longer neded, so remove that as well. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move cnd_timedwait into libcFlorian Weimer2021-05-0364-38/+81
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_cond_timedwait@@GLIBC_PRIVATE symbol is no longer neded, so remove that as well. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move cnd_signal into libcFlorian Weimer2021-05-0363-31/+76
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_cond_signal@@GLIBC_PRIVATE symbol is no longer neded, so remove that as well. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move cnd_init into libcFlorian Weimer2021-05-0363-31/+76
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_cond_init@@GLIBC_PRIVATE symbol is no longer neded, so remove that as well. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move cnd_destroy into libcFlorian Weimer2021-05-0363-31/+76
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_cond_destroy@@GLIBC_PRIVATE symbol is no longer neded, so remove that as well. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move cnd_broadcast into libcFlorian Weimer2021-05-0363-31/+75
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The __pthread_cond_broadcast@@GLIBC_PRIVATE symbol is no longer neded, so remove that as well. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move call_once into libcFlorian Weimer2021-05-0364-66/+83
| | | | | | | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. This change also turns __pthread_once into a compatibility symbol because after the call_once move, an internal call to __pthread_once can be used. This an adjustment to __libc_once: Outside libc (e.g., in nscd), it has to call pthread_once. With __pthread_once as a compatibility symbol, it is no longer to add a new GLIBC_2.34 version after the move from libpthread, and this commit removes the new __pthread_once@@GLIBC_2.34 version. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Add pthread-in-libc, libpthread-routines-var, librt-routines-varFlorian Weimer2021-05-033-0/+9
| | | | | | | | These make variables can be used to add routines to different libraries for the Hurd and Linux builds. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* powerpc64le: Optimize memset for POWER10Raoni Fassina Firmino2021-04-306-1/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation is based on __memset_power8 and integrates a lot of suggestions from Anton Blanchard. The biggest difference is that it makes extensive use of stxvl to alignment and tail code to avoid branches and small stores. It has three main execution paths: a) "Short lengths" for lengths up to 64 bytes, avoiding as many branches as possible. b) "General case" for larger lengths, it has an alignment section using stxvl to avoid branches, a 128 bytes loop and then a tail code, again using stxvl with few branches. c) "Zeroing cache blocks" for lengths from 256 bytes upwards and set value being zero. It is mostly the __memset_power8 code but the alignment phase was simplified because, at this point, address is already 16-bytes aligned and also changed to use vector stores. The tail code was also simplified to reuse the general case tail. All unaligned stores use stxvl instructions that do not generate alignment interrupts on POWER10, making it safe to use on caching-inhibited memory. On average, this implementation provides something around 30% improvement when compared to __memset_power8. Reviewed-by: Matheus Castanho <msc@linux.ibm.com> Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* powerpc64le: Optimize memcpy for POWER10Tulio Magno Quites Machado Filho2021-04-305-1/+238
| | | | | | | | | | | | | | | | | | This implementation is based on __memcpy_power8_cached and integrates suggestions from Anton Blanchard. It benefits from loads and stores with length for short lengths and for tail code, simplifying the code. All unaligned memory accesses use instructions that do not generate alignment interrupts on POWER10, making it safe to use on caching-inhibited memory. The main loop has also been modified in order to increase instruction throughput by reducing the dependency on updates from previous iterations. On average, this implementation provides around 30% improvement when compared to __memcpy_power7 and 10% improvement in comparison to __memcpy_power8_cached.
* powerpc64le: Optimized memmove for POWER10Lucas A. M. Magalhaes2021-04-308-7/+388
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was initially based on the __memmove_power7 with some ideas from strncpy implementation for Power 9. Improvements from __memmove_power7: 1. Use lxvl/stxvl for alignment code. The code for Power 7 uses branches when the input is not naturally aligned to the width of a vector. The new implementation uses lxvl/stxvl instead which reduces pressure on GPRs. It also allows the removal of branch instructions, implicitly removing branch stalls and mispredictions. 2. Use of lxv/stxv and lxvl/stxvl pair is safe to use on Cache Inhibited memory. On Power 10 vector load and stores are safe to use on CI memory for addresses unaligned to 16B. This code takes advantage of this to do unaligned loads. The unaligned loads don't have a significant performance impact by themselves. However doing so decreases register pressure on GPRs and interdependence stalls on load/store pairs. This also improved readability as there are now less code paths for different alignments. Finally this reduces the overall code size. 3. Improved performance. This version runs on average about 30% better than memmove_power7 for lengths larger than 8KB. For input lengths shorter than 8KB the improvement is smaller, it has on average about 17% better performance. This version has a degradation of about 50% for input lengths in the 0 to 31 bytes range when dest is unaligned. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* Update kernel version to 5.12 in tst-mman-consts.py.Joseph Myers2021-04-291-1/+1
| | | | | | | | This patch updates the kernel version in the test tst-mman-consts.py to 5.12. (There are no new MAP_* constants covered by this test in 5.12 that need any other header changes.) Tested with build-many-glibcs.py.
* Update syscall lists for Linux 5.12.Joseph Myers2021-04-2826-2/+28
| | | | | | | | Linux 5.12 has one new syscall, mount_setattr. Update syscall-names.list and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py.
* regenerate ulps on x86_64 with -march=nativePaul Zimmermann2021-04-281-3/+3
| | | | | | | On x86_64, when configuring glibc with CFLAGS="-O2 -g -march=native", some tests fail. After this patch, "make check" succeeds. Tested on Intel Core i5-4590 with gcc 10.2.1.