From patchwork Tue Apr 18 21:13:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 97582 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp33011qgf; Tue, 18 Apr 2017 14:13:54 -0700 (PDT) X-Received: by 10.99.178.6 with SMTP id x6mr20345369pge.80.1492550033955; Tue, 18 Apr 2017 14:13:53 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y21si259767pgh.394.2017.04.18.14.13.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 14:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-78714-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-78714-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-78714-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=G58EZgkclsBUmXcRkTqhaplBwjHruL/ CmoyPl6oe/USTju0YB213LeTQC5VmQ4HZwUNJ18VzrHHhs94AMHLMKQwwWzWOOrv xreejkcKz+TPAQHQuOEPt6SwyoT/hFYyPbneqg1IBdC80FLyQ7AG746akls8vcDH 7maQRr5O8N7Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=7UFdfoGEXfrzSTZZ6hMmZjEUszU=; b=xRiYB lzzMdrh236QihPkoPwUv0lXtsQ1hghYBWcSGMXxjtCPvJMobne9LZWPIW3MuySh0 3lUCv7nJZTi23jS/v61oNge3yeYuhK1fjNLzkDM4xqlY50etoROn4PxfCFCesj8q ZkeYMJujPTLvGRCXeWfDNbOxNEqqObgRrsg7YA= Received: (qmail 41685 invoked by alias); 18 Apr 2017 21:13:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 41654 invoked by uid 89); 18 Apr 2017 21:13:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=2420 X-HELO: mail-qt0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=J5YGlnWhoiukUk6cSleHBfIZZDRKfQjTBo89JRxmGPc=; b=Jb8zSYAI4xX4MiB48emM04jxyeYsbwgufDFmAR8Fh48m8LSbfTogGkcEoJBYX7ymzq kvwRgp4JBn89Up+LJBTVVkxueYYRhuaM3/CxoAs4OrSiGX0X19y2VjxeMy+b5eT/kIdU thzfyKk6ju1/RvpYGdi7brQLdSyf4UnqJmvaafm5KG0SDD62Gf9A1o2PvpqDWHHYC4Ph L3N0rUF76OSu4jZIbETwPZXXahfl8N/bWrfuOKGp8jwbDVNJlglA6pUZbYpjp87LYFJ3 +nfxjGo/iQW4J1HAqq8bj1z92bT2NmlRZMwdNJos4xyJmOPZB2vDD4rfsHQNyL90Tepq BDjg== X-Gm-Message-State: AN3rC/5ikJypOReBzUqinwheeJBxK/TUe+b42O5FrPOQ7QJoG08v2kbn dO5c6nbXa61cI6yuG3Whiw== X-Received: by 10.200.43.146 with SMTP id m18mr9893746qtm.210.1492550011147; Tue, 18 Apr 2017 14:13:31 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/2] linux: Remove __ASSUME_SET_ROBUST_LIST defines Date: Tue, 18 Apr 2017 18:13:20 -0300 Message-Id: <1492550000-31374-2-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1492550000-31374-1-git-send-email-adhemerval.zanella@linaro.org> References: <1492550000-31374-1-git-send-email-adhemerval.zanella@linaro.org> 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 --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 -/* 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 -/* 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 -/* 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