about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* Remove stat wrapper functions, move them to exported symbolsAdhemerval Zanella2020-10-0954-93/+337
| | | | | | | | | | | | | | | | | | | | | | | | This patch removes the stat, stat64, lstat, lstat64, fstat, fstat64, fstatat, and fstatat64 static wrapper and add the symbol on the libc with the expected names. Both the prototypes of the internal symbol linked by the static wrappers and the inline redirectors are also removed from the installed sys/stat.h header file. The wrapper implementation license LGPL exception is also removed since it is no longer statically linked to binaries. Internally the _STAT_VER* definitions are moved to a arch-specific xstatver.h file. The internal defines that redirects internals {f}stat{at} to their {f}xstat{at} counterparts are removed for Linux (!NO_RTLD_HIDDEN). Hurd still requires them since {f}stat{at} pulls extra objects that makes the loader build fail otherwise (I haven't dig into why exactly). Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* <sys/platform/x86.h>: Add FSRCS/FSRS/FZLRM supportH.J. Lu2020-10-093-0/+18
| | | | | Add Fast Short REP CMP and SCA (FSRCS), Fast Short REP STO (FSRS) and Fast Zero-Length REP MOV (FZLRM) support to <sys/platform/x86.h>.
* <sys/platform/x86.h>: Add Intel HRESET supportH.J. Lu2020-10-092-0/+4
| | | | Add Intel HRESET support to <sys/platform/x86.h>.
* <sys/platform/x86.h>: Add AVX-VNNI supportH.J. Lu2020-10-093-0/+7
| | | | Add AVX-VNNI support to <sys/platform/x86.h>.
* <sys/platform/x86.h>: Add AVX512_FP16 supportH.J. Lu2020-10-093-3/+7
| | | | Add AVX512_FP16 support to <sys/platform/x86.h>.
* <sys/platform/x86.h>: Add Intel UINTR supportH.J. Lu2020-10-092-3/+4
| | | | Add Intel UINTR support to <sys/platform/x86.h>.
* elf: Do not pass GLRO(dl_platform), GLRO(dl_platformlen) to _dl_important_hwcapsFlorian Weimer2020-10-091-6/+6
| | | | | | | In the current code, the function can easily obtain the information on its own. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update mips64 libm-test-ulpsAdhemerval Zanella2020-10-081-1/+1
|
* Update alpha libm-test-ulpsAdhemerval Zanella2020-10-081-1/+1
|
* elf: Record whether paths come from LD_LIBRARY_PATH or --library-pathFlorian Weimer2020-10-081-2/+4
| | | | | | This allows more precise LD_DEBUG diagnostics. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add missing cancellation flags on futex_internal and pselect32Adhemerval Zanella2020-10-072-0/+2
| | | | | | | It fixes the tst-cancelx{4,5} and tst-cancel24-{static} regression on some platforms (arm and sparc32). Checked on arm-linux-gnueabihf and sparcv9-linux-gnu.
* elf: Implement _dl_writeFlorian Weimer2020-10-072-0/+36
| | | | | | | | The generic version is parallel to _dl_writev. It cannot use _dl_writev directly because the errno value needs to be obtained under a lock. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Require properly configured /dev/pts for PTYsFlorian Weimer2020-10-073-192/+43
| | | | | | | | | | | | | Current systems do not have BSD terminals, so the fallback code in posix_openpt/getpt does not do anything. Also remove the file system check for /dev/pts. Current systems always have a devpts file system mounted there if /dev/ptmx exists. grantpt is now essentially a no-op. It only verifies that the argument is a ptmx-descriptor. Therefore, this change indirectly addresses bug 24941. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: unlockpt needs to fail with EINVAL, not ENOTTY (bug 26053)Florian Weimer2020-10-071-16/+5
| | | | | | | | | | The EINVAL error code is mandated by POSIX and documented in the manual. Also clean up the unlockpt implementation a bit, assuming that TIOCSPTLCK is always defined. Enhance login/tst-grantpt to cover unlockpt corner cases. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* posix: Fix -Warray-bounds instances building timer_create [BZ #26687]Adhemerval Zanella2020-10-068-89/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 11 -Warray-bounds triggers invalid warnings when building Linux timer_create.c: ../sysdeps/unix/sysv/linux/timer_create.c: In function '__timer_create_new': ../sysdeps/unix/sysv/linux/timer_create.c:83:17: warning: array subscript 'struct timer[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds] 83 | newp->sigev_notify = (evp != NULL | ^~ ../sysdeps/unix/sysv/linux/timer_create.c:59:47: note: referencing an object of size 8 allocated by 'malloc' 59 | struct timer *newp = (struct timer *) malloc (offsetof (struct timer, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | thrfunc)); | ~~~~~~~~~ The struct allocated for !SIGEV_THREAD timers only requires two 'int' fields (sigev_notify and ktimerid) and the offsetof trick tries minimize the memory usage by only allocation the required size. However, although the resulting size is suffice for !SIGEV_THREAD time, accessing the partially allocated object is error-prone and UB. This patch fixes both issues by embedding the information whether the timer if a SIGEV_THREAD in the returned 'timer_t'. For !SIGEV_THREAD, the resulting 'timer_t' is the returned kernel timer identifer (kernel_timer_t), while for SIGEV_THREAD it uses the fact malloc returns at least _Alignof (max_align_t) pointers plus that valid kernel_timer_t are always positive to set MSB bit of the returned 'timer_t' to indicate the timer handles a SIGEV_THREAD. It allows to remove the memory allocation for !SIGEV_THREAD and also remove the 'sigev_notify' field from 'struct timer'. Checked on x86_64-linux-gnu and i686-linux-gnu.
* Replace Minumum/minumum with Minimum/minimumH.J. Lu2020-10-062-2/+2
| | | | Replace Minumum/minumum in comments with Minimum/minimum.
* Fix GCC 11 -Warray-parameter warning for __sigsetjmp (bug 26647)Joseph Myers2020-10-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes part of bug 26647 (-Werror=array-parameter error building with GCC 11 because of __sigsetjmp being declared using an array parameter in one header and a pointer parameter in another). The fix is to split the struct __jmp_buf_tag definition out to a separate bits/types/ header so it can be included in pthread.h, so that pthread.h can declare __sigsetjmp with the type contents visible, so can use an array (as in setjmp.h) rather than a pointer in the declaration. Note that several other build failures with GCC 11 remain. This does not fix the jmp_buf-related -Wstringop-overflow errors (also discussed in bug 26647), or -Warray-parameter errors for other functions (bug 26686), or -Warray-bounds errors (bug 26687). Tested, with older compilers, natively for x86_64 and with build-many-glibc.py for aarch64-linux-gnu. Tested with build-many-glibcs.py with GCC mainline for aarch64-linux-gnu that this gets past the -Warray-parameter issue for __sigsetjmp (with the next build failure being the other one discussed in bug 26647).
* Y2038: nptl: Provide futex_abstimed_wait64 supporting 64 bit timeLukasz Majewski2020-10-042-0/+76
| | | | | | | | | | | | | | | | | | This is the helper function, which uses struct __timespec64 to provide 64 bit absolute time to futex syscalls. The aim of this function is to move convoluted pre-processor macro code from sysdeps/nptl/lowlevellock-futex.h to C function in futex-internal.c The futex_abstimed_wait64 function has been put into a separate file on the purpose - to avoid issues apparent on the m68k architecture related to small number of available registers (there is not enough registers to put all necessary arguments in them if the above function would be added to futex-internal.h with __always_inline attribute). Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* sysvipc: Return EINVAL for invalid msgctl commandsAdhemerval Zanella2020-10-021-10/+31
| | | | | | | | It avoids regressions on possible future commands that might require additional libc support. The downside is new commands added by newer kernels will need further glibc support. Checked on x86_64-linux-gnu and i686-linux-gnu (Linux v4.15 and v5.4).
* sysvipc: Fix IPC_INFO and MSG_INFO handling [BZ #26639]Adhemerval Zanella2020-10-023-5/+196
| | | | | | | | | | | | | | | | Both commands are Linux extensions where the third argument is a 'struct msginfo' instead of 'struct msqid_ds' and its information does not contain any time related fields (so there is no need to extra conversion for __IPC_TIME64. The regression testcase checks for Linux specifix SysV ipc message control extension. For IPC_INFO/MSG_INFO it tries to match the values against the tunable /proc values and for MSG_STAT/MSG_STAT_ANY it check if the create message queue is within the global list returned by the kernel. Checked on x86_64-linux-gnu and on i686-linux-gnu (Linux v5.4 and on Linux v4.15).
* sysvipc: Return EINVAL for invalid semctl commandsAdhemerval Zanella2020-10-021-0/+10
| | | | | | | | It avoids regressions on possible future commands that might require additional libc support. The downside is new commands added by newer kernels will need further glibc support. Checked on x86_64-linux-gnu and i686-linux-gnu (Linux v4.15 and v5.4).
* sysvipc: Fix SEM_STAT_ANY kernel argument pass [BZ #26637]Dmitry V. Levin2020-10-023-1/+191
| | | | | | | | | | | | | | | | Handle SEM_STAT_ANY the same way as SEM_STAT so that the buffer argument of SEM_STAT_ANY is properly passed to the kernel and back. The regression testcase checks for Linux specifix SysV ipc message control extension. For IPC_INFO/SEM_INFO it tries to match the values against the tunable /proc values and for SEM_STAT/SEM_STAT_ANY it check if the create message queue is within the global list returned by the kernel. Checked on x86_64-linux-gnu and on i686-linux-gnu (Linux v5.4 and on Linux v4.15). Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* aarch64: enforce >=64K guard size [BZ #26691]Szabolcs Nagy2020-10-0219-0/+57
| | | | | | | | | | | | | | | | | | | | | | | There are several compiler implementations that allow large stack allocations to jump over the guard page at the end of the stack and corrupt memory beyond that. See CVE-2017-1000364. Compilers can emit code to probe the stack such that the guard page cannot be skipped, but on aarch64 the probe interval is 64K by default instead of the minimum supported page size (4K). This patch enforces at least 64K guard on aarch64 unless the guard is disabled by setting its size to 0. For backward compatibility reasons the increased guard is not reported, so it is only observable by exhausting the address space or parsing /proc/self/maps on linux. On other targets the patch has no effect. If the stack probe interval is larger than a page size on a target then ARCH_MIN_GUARD_SIZE can be defined to get large enough stack guard on libc allocated stacks. The patch does not affect threads with user allocated stacks. Fixes bug 26691.
* sysvipc: Fix semtimedop for Linux < 5.1 for 64-bit ABIAdhemerval Zanella2020-09-301-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Both powerpc64 and s390x provides semtimedop through __NR_ipc for pre v5.1 kernel. Neither the y2038 support (7c437d3778) nor the attempt to fix an issue for !__ASSUME_DIRECT_SYSVIPC_SYSCALLS (aaa12e9ff0) took this in consideration. This patch fixes it by issuing __NR_semtimedop_time64 iff it is defined, otherwise __NR_semtimeop is issued if both __ASSUME_DIRECT_SYSVIPC_SYSCALLS it set and __NR_semtimedop is define, other __NR_ipc is used instead. To summarize: 1. For 32-bit architetures __NR_semtimedop_time64 is always issued. The fallback is used only for !__ASSUME_TIME64_SYSCALLS and it issues either __NR_ipc or __NR_semtimedop. 2. For 64-bit architecture with wire-up SysV syscall (__ASSUME_DIRECT_SYSVIPC_SYSCALLS and __NR_semtimeop defined) __NR_semtimeop is issued. 3. Otherwise __NR_ipc is used instead. Checked on x86_64-linux-gnu, i686-linux-gnu (kernel 4.15 and 5.4), powerpc64le (kernel 4.18), and s390x (kernel 4.12). Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
* nptl: futex: Move __NR_futex_time64 alias to beginning of futex-internal.hLukasz Majewski2020-09-301-4/+4
| | | | | | | | This alias macro shall be moved to the beginning of the futex-internal.h to be easily reused by other functions, which would support 64 bit time. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Provide proper spelling for 32 bit version of futex_abstimed_waitLukasz Majewski2020-09-301-6/+6
| | | | | | | This change provides proper spelling of 32 bit __futex_abstimed_wait_cancelable32 function Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* string: Fix strerrorname_np return value [BZ #26555]Adhemerval Zanella2020-09-291-152/+149
| | | | | | | | | | | | | | | It returns the string of the error constant, not its description (as strerrordesc_np). To handle the Hurd error mapping, the ERR_MAP was removed from errlist.h to errlist.c. Also, the testcase test-strerr (added on 325081b9eb2) was not added on the check build neither it builds correctly. This patch also changed it to decouple from errlist.h, the expected return values are added explicitly for both both strerrorname_np and strerrordesc_np directly. Checked on x86_64-linux-gnu and i686-linux-gnu. I also run a make check for i686-gnu.
* Reversing calculation of __x86_shared_non_temporal_thresholdPatrick McGehearty2020-09-281-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The __x86_shared_non_temporal_threshold determines when memcpy on x86 uses non_temporal stores to avoid pushing other data out of the last level cache. This patch proposes to revert the calculation change made by H.J. Lu's patch of June 2, 2017. H.J. Lu's patch selected a threshold suitable for a single thread getting maximum performance. It was tuned using the single threaded large memcpy micro benchmark on an 8 core processor. The last change changes the threshold from using 3/4 of one thread's share of the cache to using 3/4 of the entire cache of a multi-threaded system before switching to non-temporal stores. Multi-threaded systems with more than a few threads are server-class and typically have many active threads. If one thread consumes 3/4 of the available cache for all threads, it will cause other active threads to have data removed from the cache. Two examples show the range of the effect. John McCalpin's widely parallel Stream benchmark, which runs in parallel and fetches data sequentially, saw a 20% slowdown with this patch on an internal system test of 128 threads. This regression was discovered when comparing OL8 performance to OL7. An example that compares normal stores to non-temporal stores may be found at https://vgatherps.github.io/2018-09-02-nontemporal/. A simple test shows performance loss of 400 to 500% due to a failure to use nontemporal stores. These performance losses are most likely to occur when the system load is heaviest and good performance is critical. The tunable x86_non_temporal_threshold can be used to override the default for the knowledgable user who really wants maximum cache allocation to a single thread in a multi-threaded system. The manual entry for the tunable has been expanded to provide more information about its purpose. modified: sysdeps/x86/cacheinfo.c modified: manual/tunables.texi
* linux: Add time64 recvmmsg supportAdhemerval Zanella2020-09-281-11/+52
| | | | | | | | | | | | | | | The wire-up syscall __NR_recvmmsg_time64 (for 32-bit) or __NR_recvmmsg (for 64-bit) is used as default. The 32-bit fallback is used iff __ASSUME_TIME64_SYSCALLS is not defined, which assumes the kernel ABI provides either __NR_socketcall or __NR_recvmmsg (32-bit time_t). It does not handle the timestamps on ancillary data (SCM_TIMESTAMPING records). Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* linux: Add time64 support for nanosleepAdhemerval Zanella2020-09-281-0/+50
| | | | | | | | | It uses __clock_nanosleep64 and adds the __nanosleep64 symbol. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* linux: Consolidate utimesAdhemerval Zanella2020-09-283-81/+0
| | | | | | | | | | | The generic version does not have time64 support and Linux default uses utimensat. With hppa version gone, __ASSUME_UTIMES is not used anymore. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* linux: Use 64-bit time_t syscall on clock_getcputclockidAdhemerval Zanella2020-09-281-10/+15
| | | | | | | | | | | | | | | The syscall __NR_clock_getres_time64 (for 32-bit) or __NR_clock_getres (for 64-bit) is used as default. The 32-bit fallback is used iff __ASSUME_TIME64_SYSCALLS is not defined, which assumes the kernel ABI provides either __NR_rt_sigtimedwait (32-bit time_t). Since the symbol does not use any type which might be affected by the time_t, there is no need to add a 64-bit variant. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* linux: Add time64 sigtimedwait supportAdhemerval Zanella2020-09-281-8/+42
| | | | | | | | | | | The syscall __NR_sigtimedwait_time64 (for 32-bit) or __NR_sigtimedwait (for 64-bit) is used as default. The 32-bit fallback is used iff __ASSUME_TIME64_SYSCALLS is not defined, which assumes the kernel ABI provides either __NR_rt_sigtimedwait (32-bit time_t). Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* linux: Add time64 select supportAdhemerval Zanella2020-09-281-23/+69
| | | | | | | | | | | | | The syscall __NR_pselect6_time64 (32-bit) or __NR_pselect6 (64-bit) is used as default. For architectures with __ASSUME_TIME64_SYSCALLS the 32-bit fallback uses __NR_select/__NR__newselect or __NR_pselect6 (it should cover the microblaze case where older kernels do not provide __NR_pselect6). Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* nptl: Fix __futex_abstimed_wait_cancellable32Adhemerval Zanella2020-09-281-4/+10
| | | | | | | | Similar to 64-bit time __futex_abstimed_wait_cancellable64, it should check for overflow and convert to 32-bit timespec iff timeout is not NULL. It fixes some regression on i686-linux-gnu running on a 4.15 kernel.
* sysvipc: Fix semtimeop for !__ASSUME_DIRECT_SYSVIPC_SYSCALLSAdhemerval Zanella2020-09-281-8/+3
| | | | | | | The __NR_ipc syscall does not support 64-bit time operations. It fixes 7c437d3778. Checked on i686-linux-gnu on a Linux 5.4.
* hurd: add ST_RELATIMESamuel Thibault2020-09-271-1/+3
| | | | sysdeps/mach/hurd/bits/statvfs.h (ST_RELATIME): New macro.
* powerpc: Protect dl_powerpc_cpu_features on INIT_ARCH() [BZ #26615]Raphael Moreira Zinsly2020-09-221-1/+1
| | | | | | | dl_powerpc_cpu_features also needs to be protected by __GLRO to check for the _rtld_global_ro realocation before accessing it. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* x86: Harden printf against non-normal long double values (bug 26649)Florian Weimer2020-09-223-0/+64
| | | | | | | | | | | | | | | | | | | | | | | The behavior of isnan/__builtin_isnan on bit patterns that do not correspond to something that the CPU would produce from valid inputs is currently under-defined in the toolchain. (The GCC built-in and glibc disagree.) The isnan check in PRINTF_FP_FETCH in stdio-common/printf_fp.c assumes the GCC behavior that returns true for non-normal numbers which are not specified as NaN. (The glibc implementation returns false for such numbers.) At present, passing non-normal numbers to __mpn_extract_long_double causes this function to produce irregularly shaped multi-precision integers, triggering undefined behavior in __printf_fp_l. With GCC 10 and glibc 2.32, this behavior is not visible because __builtin_isnan is used, which avoids calling __mpn_extract_long_double in this case. This commit updates the implementation of __mpn_extract_long_double so that regularly shaped multi-precision integers are produced in this case, avoiding undefined behavior in __printf_fp_l.
* x86: Use one ldbl2mpn.c file for both i386 and x86_64Florian Weimer2020-09-223-2/+1
|
* Update mallinfo2 ABI, and testDJ Delorie2020-09-1733-0/+33
| | | | | | | This patch adds the ABI-related bits to reflect the new mallinfo2 function, and adds a test case to verify basic functionality. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Allow memset local PLT reference for RISC-V.Alistair Francis2020-09-171-0/+1
| | | | | | | | | | | | | | | | This is similar to commit a26e2e9feab87d4f745c31411458b048742ac733 "Allow memset local PLT reference for powerpc soft-float.". GCC 10.1 results in the localplt test failing for RISC-V. From the original commit for power-pc: Since memset is documented as a function GCC may always implicitly generate calls to, it seems reasonable to allow that local PLT reference (just like those for libgcc functions that GCC implicitly generates calls to and that are also exported from libc.so), which this patch does. Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
* powerpc: fix ifunc implementation list for POWER9 strlen and stpcpyRaphael Moreira Zinsly2020-09-171-2/+2
| | | | | __strlen_power9 and __stpcpy_power9 were added to their ifunc lists using the wrong function names.
* x86: Use HAS_CPU_FEATURE with IBT and SHSTK [BZ #26625]H.J. Lu2020-09-173-6/+4
| | | | | | | | | | | | | | | | commit 04bba1e5d84b6fd8d3a3b006bc240cd5d241ee30 Author: H.J. Lu <hjl.tools@gmail.com> Date: Wed Aug 5 13:51:56 2020 -0700 x86: Set CPU usable feature bits conservatively [BZ #26552] Set CPU usable feature bits only for CPU features which are usable in user space and whose usability can be detected from user space, excluding features like FSGSBASE whose enable bit can only be checked in the kernel. no longer turns on the usable bits of IBT and SHSTK since we don't know if IBT and SHSTK are usable until much later. Use HAS_CPU_FEATURE to check if the processor supports IBT and SHSTK.
* <sys/platform/x86.h>: Add Intel Key Locker supportH.J. Lu2020-09-163-3/+42
| | | | | | | | | | | | | | | | | | | | | | | Add Intel Key Locker: https://software.intel.com/content/www/us/en/develop/download/intel-key-locker-specification.html support to <sys/platform/x86.h>. Intel Key Locker has 1. KL: AES Key Locker instructions. 2. WIDE_KL: AES wide Key Locker instructions. 3. AESKLE: AES Key Locker instructions are enabled by OS. Applications should use if (CPU_FEATURE_USABLE (KL)) and if (CPU_FEATURE_USABLE (WIDE_KL)) to check if AES Key Locker instructions and AES wide Key Locker instructions are usable.
* pselect.c: Pass a pointer to SYSCALL_CANCEL [BZ #26606]H.J. Lu2020-09-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | commit a92f4e6299fe0e3cb6f77e79de00817aece501ce Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Jul 6 13:27:12 2020 -0300 linux: Add time64 pselect support changed pselect.c to r = SYSCALL_CANCEL (pselect6_time64, nfds, readfds, writefds, exceptfds, timeout, ((__syscall_ulong_t[]){ (uintptr_t) sigmask, __NSIG_BYTES })); which doesn't work with x32's ARGIFY and data passed to syscall isn't initialized with sigmask and __NSIG_BYTES. Change to __syscall_ulong_t data[2] = { (uintptr_t) sigmask, __NSIG_BYTES }; r = SYSCALL_CANCEL (pselect6_time64, nfds, readfds, writefds, exceptfds, timeout, data); fixes [BZ #26606].
* hurd: Add __x86_get_cpu_features to ld.abilistH.J. Lu2020-09-131-0/+1
| | | | Add __x86_get_cpu_features to ld.abilist for <sys/platform/x86.h>.
* x86: Install <sys/platform/x86.h> [BZ #26124]H.J. Lu2020-09-1116-247/+658
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Install <sys/platform/x86.h> so that programmers can do #if __has_include(<sys/platform/x86.h>) #include <sys/platform/x86.h> #endif ... if (CPU_FEATURE_USABLE (SSE2)) ... if (CPU_FEATURE_USABLE (AVX2)) ... <sys/platform/x86.h> exports only: enum { COMMON_CPUID_INDEX_1 = 0, COMMON_CPUID_INDEX_7, COMMON_CPUID_INDEX_80000001, COMMON_CPUID_INDEX_D_ECX_1, COMMON_CPUID_INDEX_80000007, COMMON_CPUID_INDEX_80000008, COMMON_CPUID_INDEX_7_ECX_1, /* Keep the following line at the end. */ COMMON_CPUID_INDEX_MAX }; struct cpuid_features { struct cpuid_registers cpuid; struct cpuid_registers usable; }; struct cpu_features { struct cpu_features_basic basic; struct cpuid_features features[COMMON_CPUID_INDEX_MAX]; }; /* Get a pointer to the CPU features structure. */ extern const struct cpu_features *__x86_get_cpu_features (unsigned int max) __attribute__ ((const)); Since all feature checks are done through macros, programs compiled with a newer <sys/platform/x86.h> are compatible with the older glibc binaries as long as the layout of struct cpu_features is identical. The features array can be expanded with backward binary compatibility for both .o and .so files. When COMMON_CPUID_INDEX_MAX is increased to support new processor features, __x86_get_cpu_features in the older glibc binaries returns NULL and HAS_CPU_FEATURE/CPU_FEATURE_USABLE return false on the new processor feature. No new symbol version is neeeded. Both CPU_FEATURE_USABLE and HAS_CPU_FEATURE are provided. HAS_CPU_FEATURE can be used to identify processor features. Note: Although GCC has __builtin_cpu_supports, it only supports a subset of <sys/platform/x86.h> and it is equivalent to CPU_FEATURE_USABLE. It doesn't support HAS_CPU_FEATURE.
* linux: Add time64 pselect supportAdhemerval Zanella2020-09-114-35/+99
| | | | | | | | | | | | | | | The syscall __NR_pselect6_time64 (32-bit) or __NR_pselect6 (64-bit) is used as default. For architectures with __ASSUME_TIME64_SYSCALLS the 32-bit fallback uses __NR_pselec6. To accomodate microblaze missing pselect6 support on kernel older than 3.15 the fallback is moved to its own function to the microblaze specific implementation can override it. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* linux: Add time64 semtimedop supportAdhemerval Zanella2020-09-112-8/+55
| | | | | | | | | | | | Either the __NR_semtimedop_time64 (for 32-bit) or the __NR_semtimedop (for 64-bit) syscall is used as default. The 32-bit fallback is used iff __ASSUME_TIME64_SYSCALLS is not defined, which assumes the kernel ABI provides either __NR_ipc or __NR_semtimeop (for 32-bit time_t). Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Alistair Francis <alistair.francis@wdc.com>