about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
...
* hurd: Fix strerror not setting errnoSamuel Thibault2020-07-071-5/+11
| | | | | * sysdeps/mach/strerror_l.c: Include <errno.h>. (__strerror_l): Save errno on entry and restore it on exit.
* hurd: Evaluate fd before entering the critical sectionSamuel Thibault2020-07-071-1/+2
| | | | | * sysdeps/hurd/include/hurd/fd.h (HURD_FD_PORT_USE_CANCEL): Evaluate fd before calling _hurd_critical_section_lock.
* string: Add strerrorname_np and strerrordesc_npAdhemerval Zanella2020-07-0732-0/+66
| | | | | | | | | | | | | | | | | The strerrorname_np returns error number name (e.g. "EINVAL" for EINVAL) while strerrordesc_np returns string describing error number (e.g "Invalid argument" for EINVAL). Different than strerror, strerrordesc_np does not attempt to translate the return description, both functions return NULL for an invalid error number. They should be used instead of sys_errlist and sys_nerr, both are thread and async-signal safe. These functions are GNU extensions. Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, and s390x-linux-gnu. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* string: Add sigabbrev_np and sigdescr_npAdhemerval Zanella2020-07-0731-0/+62
| | | | | | | | | | | | | | | | | | The sigabbrev_np returns the abbreviated signal name (e.g. "HUP" for SIGHUP) while sigdescr_np returns the string describing the error number (e.g "Hangup" for SIGHUP). Different than strsignal, sigdescr_np does not attempt to translate the return description and both functions return NULL for an invalid signal number. They should be used instead of sys_siglist or sys_sigabbrev and they are both thread and async-signal safe. They are added as GNU extensions on string.h header (same as strsignal). Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, and s390x-linux-gnu. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* string: Simplify strerror_rAdhemerval Zanella2020-07-071-62/+5
| | | | | | | | | | | | Use snprintf instead of mempcpy plus itoa_word and remove unused definitions. There is no potential for infinite recursion because snprintf only use strerror_r for the %m specifier. Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, and s390x-linux-gnu. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* string: Use tls-internal on strerror_lAdhemerval Zanella2020-07-074-21/+14
| | | | | | | | | | The buffer allocation uses the same strategy of strsignal. Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, and s390x-linux-gnu. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* string: Implement strerror in terms of strerror_lAdhemerval Zanella2020-07-071-1/+3
| | | | | | | | | | | | | | If the thread is terminated then __libc_thread_freeres will free the storage via __glibc_tls_internal_free. It is only within the calling thread that this matters. It makes strerror MT-safe. Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, and s390x-linux-gnu. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* string: Remove old TLS usage on strsignalAdhemerval Zanella2020-07-076-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The per-thread state is refactored two use two strategies: 1. The default one uses a TLS structure, which will be placed in the static TLS space (using __thread keyword). 2. Linux allocates via struct pthread and access it through THREAD_* macros. The default strategy has the disadvantage of increasing libc.so static TLS consumption and thus decreasing the possible surplus used in some scenarios (which might be mitigated by BZ#25051 fix). It is used only on Hurd, where accessing the thread storage in the in single thread case is not straightforward (afaiu, Hurd developers could correct me here). The fallback static allocation used for allocation failure is also removed: defining its size is problematic without synchronizing with translated messages (to avoid partial translation) and the resulting usage is not thread-safe. Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, and s390x-linux-gnu. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Fix __NSIG_WORDS and add __NSIG_BYTESAdhemerval Zanella2020-07-0712-26/+39
| | | | | | | | | | | | | | The __NSIG_WORDS value is based on minimum number of words to hold the maximum number of signals supported by the architecture. This patch also adds __NSIG_BYTES, which is the number of bytes required to represent the supported number of signals. It is used in syscalls which takes a sigset_t. Checked on x86_64-linux-gnu and i686-linux-gnu. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* signal: Move sys_errlist to a compat symbolAdhemerval Zanella2020-07-0718-1855/+1018
| | | | | | | | | | | | | | | | | | | | The symbol is deprecated by strerror since its usage imposes some issues such as copy relocations. Its internal name is also changed to _sys_errlist_internal to avoid static linking usage. The compat code is also refactored by removing the over enginered errlist-compat.c generation from manual entried and extra comment token in linker script file. It disantangle the code generation from manual and simplify both Linux and Hurd compat code. The definitions from errlist.c are moved to errlist.h and a new test is added to avoid a new errno entry without an associated one in manual. Checked on x86_64-linux-gnu and i686-linux-gnu. I also run a check-abi on all affected platforms. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* signal: Move sys_siglist to a compat symbolAdhemerval Zanella2020-07-075-87/+69
| | | | | | | | | | | | | | | | | | | The symbol was deprecated by strsignal and its usage imposes issues such as copy relocations. Its internal name is changed to __sys_siglist and __sys_sigabbrev to avoid static linking usage. The compat code is also refactored, since both Linux and Hurd usage the same strategy: export the same array with different object sizes. The libSegfault change avoids calling strsignal on the SIGFAULT signal handler (the current usage is already sketchy, adding a call that potentially issue locale internal function is even sketchier). Checked on x86_64-linux-gnu and i686-linux-gnu. I also run a check-abi on all affected platforms. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* signal: Add signum-{generic,arch}.hAdhemerval Zanella2020-07-0713-316/+397
| | | | | | | | | | | | | | | | | | | | It refactor how signals are defined by each architecture. Instead of include a generic header (bits/signum-generic.h) and undef non-default values in an arch specific header (bits/signum.h) the new scheme uses a common definition (bits/signum-generic.h) and each architectures add its specific definitions on a new header (bits/signum-arch.h). For Linux it requires copy some system default definitions to alpha, hppa, and sparc. They are historical values and newer ports uses the generic Linux signum-arch.h. For Hurd the BSD signum is removed and moved to a new header (it is used currently only on Hurd). Checked on a build against all affected ABIs. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* x86: Add thresholds for "rep movsb/stosb" to tunablesH.J. Lu2020-07-066-26/+70
| | | | | | | | | | Add x86_rep_movsb_threshold and x86_rep_stosb_threshold to tunables to update thresholds for "rep movsb" and "rep stosb" at run-time. Note that the user specified threshold for "rep movsb" smaller than the minimum threshold will be ignored. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Use C2x return value from getpayload of non-NaN (bug 26073).Joseph Myers2020-07-066-0/+18
| | | | | | | | | | | | | | | In TS 18661-1, getpayload had an unspecified return value for a non-NaN argument, while C2x requires the return value -1 in that case. This patch implements the return value of -1. I don't think this is worth having a new symbol version that's an alias of the old one, although occasionally we do that in such cases where the new function semantics are a refinement of the old ones (to avoid programs relying on the new semantics running on older glibc versions but not behaving as intended). Tested for x86_64 and x86; also ran math/ tests for aarch64 and powerpc.
* x86: Detect Extended Feature Disable (XFD)H.J. Lu2020-07-062-0/+4
| | | | | | | An extension called extended feature disable (XFD) is an extension added for Intel AMX to the XSAVE feature set that allows an operating system to enable a feature while preventing specific user threads from using the feature.
* x86: Correct bit_cpu_CLFSH [BZ #26208]H.J. Lu2020-07-061-1/+1
| | | | bit_cpu_CLFSH should be (1u << 19), not (1u << 20).
* Add the __libc_single_threaded variableFlorian Weimer2020-07-0632-0/+32
| | | | | | | | | | | | | | The variable is placed in libc.so, and it can be true only in an outer libc, not libcs loaded via dlmopen or static dlopen. Since thread creation from inner namespaces does not work, pthread_create can update __libc_single_threaded directly. Using __libc_early_init and its initial flag, implementation of this variable is very straightforward. A future version may reset the flag during fork (but not in an inner namespace), or after joining all threads except one. Reviewed-by: DJ Delorie <dj@redhat.com>
* Linux: rseq registration testsMathieu Desnoyers2020-07-064-1/+388
| | | | | | | | | | | | | | | These tests validate that rseq is registered from various execution contexts (main thread, destructor, other threads, other threads created from destructor, forked process (without exec), pthread_atfork handlers, pthread setspecific destructors, signal handlers, atexit handlers). tst-rseq.c only links against libc.so, testing registration of rseq in a non-multithreaded environment. tst-rseq-nptl.c also links against libpthread.so, testing registration of rseq in a multithreaded environment. See the Linux kernel selftests for extensive rseq stress-tests.
* Linux: Use rseq in sched_getcpu if availableMathieu Desnoyers2020-07-061-2/+20
| | | | | | | | | | | | | When available, use the cpu_id field from __rseq_abi on Linux to implement sched_getcpu(). Fall-back on the vgetcpu vDSO if unavailable. Benchmarks: x86-64: Intel E5-2630 v3@2.40GHz, 16-core, hyperthreading glibc sched_getcpu(): 13.7 ns (baseline) glibc sched_getcpu() using rseq: 2.5 ns (speedup: 5.5x) inline load cpuid from __rseq_abi TLS: 0.8 ns (speedup: 17.1x)
* Linux: Perform rseq registration at C startup and thread creationMathieu Desnoyers2020-07-0643-2/+683
| | | | | | | | | | | | | | | | | | | Register rseq TLS for each thread (including main), and unregister for each thread (excluding main). "rseq" stands for Restartable Sequences. See the rseq(2) man page proposed here: https://lkml.org/lkml/2018/9/19/647 Those are based on glibc master branch commit 3ee1e0ec5c. The rseq system call was merged into Linux 4.18. The TLS_STATIC_SURPLUS define is increased to leave additional room for dlopen'd initial-exec TLS, which keeps elf/tst-auditmany working. The increase (76 bytes) is larger than 32 bytes because it has not been increased in quite a while. The cost in terms of additional TLS storage is quite significant, but it will also obscure some initial-exec-related dlopen failures.
* Linux: Fix UTC offset setting in settimeofday for __TIMESIZE != 64Florian Weimer2020-06-301-3/+8
| | | | | | | | | | The time argument is NULL in this case, and attempt to convert it leads to a null pointer dereference. This fixes commit d2e3b697da2433c08702f95c76458c51545c3df1 ("y2038: linux: Provide __settimeofday64 implementation"). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update kernel version to 5.7 in tst-mman-consts.py.Joseph Myers2020-06-291-1/+1
| | | | | | | | | This patch updates the kernel version in the test tst-mman-consts.py to 5.7. (There are no new constants covered by this test in 5.7 that need any other header changes; there's a new MREMAP_DONTUNMAP, but this test doesn't yet cover MREMAP_*.) Tested with build-many-glibcs.py.
* powerpc: Add support for POWER10Tulio Magno Quites Machado Filho2020-06-2914-3/+26
| | | | | | | | 1. Add the directories to hold POWER10 files. 2. Add support to select POWER10 libraries based on AT_PLATFORM. 3. Let submachine=power10 be set automatically.
* hurd: Simplify usleep timeout computationSamuel Thibault2020-06-291-5/+2
| | | | | | as suggested by Andreas Schwab * sysdeps/mach/usleep.c (usleep): Divide timeout in an overflow-safe way.
* htl: Enable cancel*16 an cancel*20 testsSamuel Thibault2020-06-296-4/+509
| | | | | | | | | | * nptl/tst-cancel16.c, tst-cancel20.c, tst-cancelx16.c, tst-cancelx20.c: Move to... * sysdeps/pthread: ... here. * nptl/Makefile: Move corresponding references and rules to... * sysdeps/pthread/Makefile: ... here. * sysdeps/mach/hurd/i386/Makefile: Xfail tst-cancel*16 for now: missing barrier pshared support, but test should be working otherwise.
* hurd: Add remaining cancelation pointsSamuel Thibault2020-06-2811-8/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hurd/hurdselect.c: Include <sysdep-cancel.h>. (_hurd_select): Surround call to __mach_msg with enabling async cancel. * sysdeps/mach/hurd/accept4.c: Include <sysdep-cancel.h>. (__libc_accept4): Surround call to __socket_accept with enabling async cancel, and use HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE. * sysdeps/mach/hurd/connect.c: Include <sysdep-cancel.h>. (__connect): Surround call to __file_name_lookup and __socket_connect with enabling async cancel, and use HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE. * sysdeps/mach/hurd/fdatasync.c: Include <sysdep-cancel.h>. (fdatasync): Surround call to __file_sync with enabling async cancel, and use HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE. * sysdeps/mach/hurd/fsync.c: Include <sysdep-cancel.h>. (fsync): Surround call to __file_sync with enabling async cancel, and use HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE. * sysdeps/mach/hurd/ioctl.c: Include <sysdep-cancel.h>. (__ioctl): When request is TIOCDRAIN, surround call to send_rpc with enabling async cancel, and use HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE. * sysdeps/mach/hurd/msync.c: Include <sysdep-cancel.h>. (msync): Surround call to __vm_object_sync with enabling async cancel. * sysdeps/mach/hurd/sigsuspend.c: Include <sysdep-cancel.h>. (__sigsuspend): Surround call to __mach_msg with enabling async cancel. * sysdeps/mach/hurd/sigwait.c: Include <sysdep-cancel.h>. (__sigwait): Surround wait code with enabling async cancel. * sysdeps/mach/msync.c: Include <sysdep-cancel.h>. (msync): Surround call to __vm_msync with enabling async cancel. * sysdeps/mach/sleep.c: Include <sysdep-cancel.h>. (__sleep): Surround call to __mach_msg with enabling async cancel. * sysdeps/mach/usleep.c: Include <sysdep-cancel.h>. (usleep): Surround call to __vm_msync with enabling async cancel.
* hurd: fix usleep(ULONG_MAX)Samuel Thibault2020-06-281-1/+5
| | | | * sysdeps/mach/usleep.c (usleep): Clamp timeout when rouding up.
* hurd: Make fcntl(F_SETLKW*) cancellation pointsSamuel Thibault2020-06-284-8/+44
| | | | | | | | | | | | | and add _nocancel variant. * sysdeps/mach/hurd/Makefile [io] (sysdep_routines): Add fcntl_nocancel. * sysdeps/mach/hurd/fcntl.c [NOCANCEL]: Include <not-cancel.h>. [!NOCANCEL]: Include <sysdep-cancel.h>. (__libc_fcntl) [!NOCANCEL]: Surround __file_record_lock call with enabling async cancel, and use HURD_FD_PORT_USE_CANCEL instead of HURD_FD_PORT_USE. * sysdeps/mach/hurd/fcntl_nocancel.c: New file, defines __fcntl_nocancel by including fcntl.c. * sysdeps/mach/hurd/not-cancel.h (__fcntl64_nocancel): Replace macro with __fcntl_nocancel declaration with hidden proto, and make __fcntl64_nocancel call __fcntl_nocancel.
* hurd: make wait4 a cancellation pointSamuel Thibault2020-06-284-6/+70
| | | | | | | | | | | | | | and add _nocancel variant. * sysdeps/mach/hurd/Makefile [io] (sysdep_routines): Add wait4_nocancel. * sysdeps/mach/hurd/wait4.c: Include <sysdep-cancel.h> (__wait4): Surround __proc_wait with enabling async cancel, and use __USEPORT_CANCEL instead of __USEPORT. * sysdeps/mach/hurd/wait4_nocancel.c: New file, contains previous implementation of __wait4. * sysdeps/mach/hurd/not-cancel.h (__waitpid_nocancel): Replace macro with __wait4_nocancel declaration with hidden proto, and make __waitpid_nocancel call __wait4_nocancel.
* hurd: Fix port definition in HURD_PORT_USE_CANCELSamuel Thibault2020-06-281-0/+3
| | | | | * sysdeps/hurd/include/hurd/port.h: Include <libc-lock.h>. (HURD_PORT_USE_CANCEL): Add local port variable.
* hurd: make close a cancellation pointSamuel Thibault2020-06-287-6/+50
| | | | | | | | | | | | | | and add _nocancel variant. * sysdeps/mach/hurd/Makefile [io] (sysdep_routines): Add close_nocancel. * sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE, ld.GLIBC_PRIVATE): Add __close_nocancel. * sysdeps/mach/hurd/i386/localplt.data (__close_nocancel): Allow PLT. * sysdeps/mach/hurd/close.c: Include <sysdep-cancel.h> (__libc_close): Surround _hurd_fd_close with enabling async cancel. * sysdeps/mach/hurd/close_nocancel.c: New file. * sysdeps/mach/hurd/not-cancel.h (__close_nocancel): Replace macro with declaration with hidden proto.
* hurd: make open and openat cancellation pointsSamuel Thibault2020-06-289-10/+138
| | | | | | | | | | | | | | | | | | | | | and add _nocancel variants. * sysdeps/mach/hurd/Makefile [io] (sysdep_routines): Add open_nocancel openat_nocancel. * sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE, ld.GLIBC_PRIVATE): Add __open_nocancel. * sysdeps/mach/hurd/dl-sysdep.c (__open_nocancel): Add alias, check it is not hidden. * sysdeps/mach/hurd/i386/localplt.data (__open_nocancel): Allow PLT. * sysdeps/mach/hurd/not-cancel.h (__open_nocancel, __openat_nocancel: Replace macros with declarations with hidden proto. (__open64_nocancel, __openat64_nocancel): Call __open_nocancel and __openat_nocancel instead of __open64 and __openat64. * sysdeps/mach/hurd/open.c: Include <sysdep-cancel.h> (__libc_open): Surround __file_name_lookup with enabling async cancel. * sysdeps/mach/hurd/openat.c: Likewise. * sysdeps/mach/hurd/open_nocancel.c, sysdeps/mach/hurd/openat_nocancel.c: New files.
* hurd: clean fd and port on thread cancelSamuel Thibault2020-06-289-24/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HURD_*PORT_USE link fd and port with a stack-stored structure, so on thread cancel we need to cleanup this. * hurd/fd-cleanup.c: New file. * hurd/port-cleanup.c (_hurd_port_use_cleanup): New function. * hurd/Makefile (routines): Add fd-cleanup. * sysdeps/hurd/include/hurd.h (__USEPORT_CANCEL): New macro. * sysdeps/hurd/include/hurd/fd.h (_hurd_fd_port_use_data): New structure. (_hurd_fd_port_use_cleanup): New prototype. (HURD_DPORT_USE_CANCEL, HURD_FD_PORT_USE_CANCEL): New macros. * sysdeps/hurd/include/hurd/port.h (_hurd_port_use_data): New structure. (_hurd_port_use_cleanup): New prototype. (HURD_PORT_USE_CANCEL): New macro. * hurd/hurd/fd.h (HURD_FD_PORT_USE): Also refer to HURD_FD_PORT_USE_CANCEL. * hurd/hurd.h (__USEPORT): Also refer to __USEPORT_CANCEL. * hurd/hurd/port.h (HURD_PORT_USE): Also refer to HURD_PORT_USE_CANCEL. * hurd/fd-read.c (_hurd_fd_read): Call HURD_FD_PORT_USE_CANCEL instead of HURD_FD_PORT_USE. * hurd/fd-write.c (_hurd_fd_write): Likewise. * sysdeps/mach/hurd/send.c (__send): Call HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE. * sysdeps/mach/hurd/sendmsg.c (__libc_sendmsg): Likewise. * sysdeps/mach/hurd/sendto.c (__sendto): Likewise. * sysdeps/mach/hurd/recv.c (__recv): Likewise. * sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise. * sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Call __USEPORT_CANCEL instead of __USEPORT, and HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE.
* htl: Move cleanup handling to non-private libc-lockSamuel Thibault2020-06-282-33/+70
| | | | | | | | | | | | | | | | | This adds sysdeps/htl/libc-lock.h which augments sysdeps/mach/libc-lock.h with the htl-aware cleanup handling. Otherwise inclusion of libc-lock.h without libc-lockP.h would keep only the mach-aware handling. This also fixes cleanup getting called when the binary is statically-linked without libpthread. * sysdeps/htl/libc-lockP.h (__libc_cleanup_region_start, __libc_cleanup_end, __libc_cleanup_region_end, __pthread_get_cleanup_stack): Move to... * sysdeps/htl/libc-lock.h: ... new file. (__libc_cleanup_region_start): Always set handler and arg. (__libc_cleanup_end): Always call the cleanup handler. (__libc_cleanup_push, __libc_cleanup_pop): New macros.
* htl: Fix includes for lockfileSamuel Thibault2020-06-283-6/+3
| | | | | | | | | | | These only need exactly to use __libc_ptf_call. * sysdeps/htl/flockfile.c: Include <libc-lockP.h> instead of <libc-lock.h> * sysdeps/htl/ftrylockfile.c: Include <libc-lockP.h> instead of <errno.h>, <pthread.h>, <stdio-lock.h> * sysdeps/htl/funlockfile.c: Include <libc-lockP.h> instead of <pthread.h> and <stdio-lock.h>
* htl: avoid cancelling threads inside critical sectionsSamuel Thibault2020-06-271-0/+9
| | | | | | | | Like hurd_thread_cancel does. * sysdeps/mach/hurd/htl/pt-docancel.c: Include <hurd/signal.h> (__pthread_do_cancel): Lock target thread's critical_section_lock and ss lock around thread mangling.
* x86: Detect Intel Advanced Matrix ExtensionsH.J. Lu2020-06-263-0/+44
| | | | | | | | | | | | | | Intel Advanced Matrix Extensions (Intel AMX) is a new programming paradigm consisting of two components: a set of 2-dimensional registers (tiles) representing sub-arrays from a larger 2-dimensional memory image, and accelerators able to operate on tiles. Intel AMX is an extensible architecture. New accelerators can be added and the existing accelerator may be enhanced to provide higher performance. The initial features are AMX-BF16, AMX-TILE and AMX-INT8, which are usable only if the operating system supports both XTILECFG state and XTILEDATA state. Add AMX-BF16, AMX-TILE and AMX-INT8 support to HAS_CPU_FEATURE and CPU_FEATURE_USABLE.
* S390: Optimize __memset_z196.Stefan Liebler2020-06-261-10/+9
| | | | | | | | It turned out that an 256b-mvc instruction which depends on the result of a previous 256b-mvc instruction is counterproductive. Therefore this patch adjusts the 256b-loop by storing the first byte with stc and setting the remaining 255b with mvc. Now the 255b-mvc instruction depends on the stc instruction.
* S390: Optimize __memcpy_z196.Stefan Liebler2020-06-261-6/+15
| | | | | | This patch introduces an extra loop without pfd instructions as it turned out that the pfd instructions are usefull for copies >=64KB but are counterproductive for smaller copies.
* elf: Include <stddef.h> (for size_t), <sys/stat.h> in <ldconfig.h>Florian Weimer2020-06-251-0/+2
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* S390: Regenerate ULPs.Stefan Liebler2020-06-241-0/+2
| | | | Updates needed after recent exp10f commits.
* htl: Add wrapper header for <semaphore.h> with hidden __sem_postFlorian Weimer2020-06-243-2/+11
| | | | | | | This is required to avoid a check-localplt failure due to a sem_post call through the PLT. Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* htl: Fix case when sem_*wait is canceled while holding a tokenSamuel Thibault2020-06-241-2/+13
| | | | | | | | * sysdeps/htl/sem-timedwait.c (struct cancel_ctx): Add cancel_wake field. (cancel_hook): When unblocking thread, set cancel_wake field to 1. (__sem_timedwait_internal): Set cancel_wake field to 0 by default. On cancellation exit, check whether we hold a token, to be put back.
* htl: Make sem_*wait cancellations pointsSamuel Thibault2020-06-244-12/+217
| | | | | | | | | | | | | | By aligning its implementation on pthread_cond_wait. * sysdeps/htl/sem-timedwait.c (cancel_ctx): New structure. (cancel_hook): New function. (__sem_timedwait_internal): Check for cancellation and register cancellation hook that wakes the thread up, and check again for cancellation on exit. * nptl/tst-cancel13.c, nptl/tst-cancelx13.c: Move to... * sysdeps/pthread/: ... here. * nptl/Makefile: Move corresponding references and rules to... * sysdeps/pthread/Makefile: ... here.
* htl: Simplify non-cancel path of __pthread_cond_timedwait_internalSamuel Thibault2020-06-241-20/+21
| | | | | | | | | Since __pthread_exit does not return, we do not need to indent the noncancel path * sysdeps/htl/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): Move cancelled path before non-cancelled path, to avoid "else" indentation.
* htl: Enable tst-cancel25 testSamuel Thibault2020-06-242-1/+174
| | | | | | | | * nptl/tst-cancel25.c: Move to... * sysdeps/pthread/tst-cancel25.c: ... here. (tf2) Do not test for SIGCANCEL when it is not defined. * nptl/Makefile: Move corresponding reference to... * sysdeps/pthread/Makefile: ... here.
* powerpc: Add new hwcap valuesTulio Magno Quites Machado Filho2020-06-232-1/+3
| | | | | | | | | Linux commit ID ee988c11acf6f9464b7b44e9a091bf6afb3b3a49 reserved 2 new bits in AT_HWCAP2: - PPC_FEATURE2_ARCH_3_1 indicates the availability of the POWER ISA 3.1; - PPC_FEATURE2_MMA indicates the availability of the Matrix-Multiply Assist facility.
* aarch64: MTE compatible strncmpAlex Butler2020-06-231-99/+145
| | | | | | | | | | | | | Add support for MTE to strncmp. Regression tested with xcheck and benchmarked with glibc's benchtests on the Cortex-A53, Cortex-A72, and Neoverse N1. The existing implementation assumes that any access to the pages in which the string resides is safe. This assumption is not true when MTE is enabled. This patch updates the algorithm to ensure that accesses remain within the bounds of an MTE tag (16-byte chunks) and improves overall performance. Co-authored-by: Branislav Rankov <branislav.rankov@arm.com> Co-authored-by: Wilco Dijkstra <wilco.dijkstra@arm.com>
* aarch64: MTE compatible strcmpAlex Butler2020-06-231-109/+125
| | | | | | | | | | | | | Add support for MTE to strcmp. Regression tested with xcheck and benchmarked with glibc's benchtests on the Cortex-A53, Cortex-A72, and Neoverse N1. The existing implementation assumes that any access to the pages in which the string resides is safe. This assumption is not true when MTE is enabled. This patch updates the algorithm to ensure that accesses remain within the bounds of an MTE tag (16-byte chunks) and improves overall performance. Co-authored-by: Branislav Rankov <branislav.rankov@arm.com> Co-authored-by: Wilco Dijkstra <wilco.dijkstra@arm.com>
* aarch64: MTE compatible strrchrAlex Butler2020-06-231-114/+91
| | | | | | | | | | | | Add support for MTE to strrchr. Regression tested with xcheck and benchmarked with glibc's benchtests on the Cortex-A53, Cortex-A72, and Neoverse N1. The existing implementation assumes that any access to the pages in which the string resides is safe. This assumption is not true when MTE is enabled. This patch updates the algorithm to ensure that accesses remain within the bounds of an MTE tag (16-byte chunks) and improves overall performance. Co-authored-by: Wilco Dijkstra <wilco.dijkstra@arm.com>