diff mbox series

[2/2] linux: Remove __ASSUME_SET_ROBUST_LIST defines

Message ID 1492550000-31374-2-git-send-email-adhemerval.zanella@linaro.org
State New
Headers show
Series [1/2] nptl: Remove __ASSUME_SET_ROBUST_LIST | expand

Commit Message

Adhemerval Zanella April 18, 2017, 9:13 p.m. UTC
As for the first part, I am sending this patch again.  The onyl change
was to rebase again master after __ASSUME_REQUEUE_PI removal (2e4cf77897).

--

This patch removes __ASSUME_SET_ROBUST_LIST usage and assumes that
kernel will correctly return if it supports or not
futex_atomic_cmpxchg_inatomic.

On minimum supported kernel (v3.2 and v2.6.32 for x86) kernel has:

2418 SYSCALL_DEFINE2(set_robust_list, struct robust_list_head __user *, head,
2419                 size_t, len)
2420 {
2421         if (!futex_cmpxchg_enabled)
2422                 return -ENOSYS;

The patch also adds the __set_robust_list_avail runtime check for all
architectures, since for some the syscall may still return ENOSYS if
futex_atomic_cmpxchg_inatomic is not supported (for instance ARM).

Tested on armhf (with 3.8 kernel) and x86_64.

	* sysdeps/unix/sysv/linux/arm/kernel-features.h
	(__ASSUME_SET_ROBUST_LIST): Likewise.
	* sysdeps/unix/sysv/linux/kernel-features.h:
	(__ASSUME_SET_ROBUST_LIST): Likewise.
	* sysdeps/unix/sysv/linux/m68k/kernel-features.h:
	(__ASSUME_SET_ROBUST_LIST): Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel-features.h:
	(__ASSUME_SET_ROBUST_LIST): Likewise.
	* sysdeps/unix/sysv/linux/sparc/kernel-features.h:
	(__ASSUME_SET_ROBUST_LIST): Likewise.
---
 sysdeps/unix/sysv/linux/arm/kernel-features.h   | 7 -------
 sysdeps/unix/sysv/linux/kernel-features.h       | 5 -----
 sysdeps/unix/sysv/linux/mips/kernel-features.h  | 6 ------
 sysdeps/unix/sysv/linux/sparc/kernel-features.h | 6 ------
 4 files changed, 24 deletions(-)

-- 
2.7.4
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index e13b049..1edd988 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -19,13 +19,6 @@ 
 
 #include_next <kernel-features.h>
 
-/* The ARM kernel before 3.14.3 may or may not support
-   futex_atomic_cmpxchg_inatomic, depending on kernel
-   configuration.  */
-#if __LINUX_KERNEL_VERSION < 0x030E03
-# undef __ASSUME_SET_ROBUST_LIST
-#endif
-
 /* ARM fadvise64_64 reorganize the syscall arguments.  */
 #define __ASSUME_FADVISE64_64_6ARG	1
 
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 233e302..2a25eb6 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -59,11 +59,6 @@ 
    they were introduced in 2.6.17-rc1, on SH in 2.6.19-rc1.  */
 #define __ASSUME_ATFCTS	1
 
-/* Support for inter-process robust mutexes was added in 2.6.17 (but
-   some architectures lack futex_atomic_cmpxchg_inatomic in some
-   configurations).  */
-#define __ASSUME_SET_ROBUST_LIST	1
-
 /* Support for private futexes was added in 2.6.22.  */
 #define __ASSUME_PRIVATE_FUTEX	1
 
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index d5d35af..9d533aa 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -21,12 +21,6 @@ 
 
 #include_next <kernel-features.h>
 
-/* The MIPS kernel does not support futex_atomic_cmpxchg_inatomic if
-   emulating LL/SC.  */
-#if __mips == 1 || defined _MIPS_ARCH_R5900
-# undef __ASSUME_SET_ROBUST_LIST
-#endif
-
 /* Define this if your 32-bit syscall API requires 64-bit register
    pairs to start with an even-number register.  */
 #if _MIPS_SIM == _ABIO32
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index c833201..7dc8f11 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -31,12 +31,6 @@ 
 
 #include_next <kernel-features.h>
 
-/* 32-bit SPARC kernels do not support
-   futex_atomic_cmpxchg_inatomic.  */
-#if !defined __arch64__ && !defined __sparc_v9__
-# undef __ASSUME_SET_ROBUST_LIST
-#endif
-
 #if !defined __arch64__
 # undef __ASSUME_ACCEPT_SYSCALL
 # undef __ASSUME_CONNECT_SYSCALL