From patchwork Wed Oct 7 16:23:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 54600 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id AAB1222FF8 for ; Wed, 7 Oct 2015 16:24:48 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf9737368lbc.1 for ; Wed, 07 Oct 2015 09:24:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results; bh=DSE2+ReOR+D9ih1vSnDn7Ptf1Bop2BHua1Q7MulTgSo=; b=JwtJbE53WvkSvAejUOGumhjbZ1fO5Aj7BRc1GTzIAVy7iGGFE8Zpjrm5TcKO8I25m2 EmXY1PweXe4lWpXeLhaARObbVrlXSh2DIYXkIdiRIHtN7j4zM4U1pUmJjmBFb1NOzTzh 10A7Ichfz4R79inXjzXS9CrR3EHidJ3xxDMMjfGk2kK+8HqG5FgGQbW5s/r46IeEETFW ZmHJRwSZ0zaU3Pl/HiAnu7Fg5OYL1tfQ47qTlrC0FQ3aKr1g7W667jJ/Bkld2rspivj7 sWo1d6JoX6ANVczQ0BOFYutPI8aWlV9McFEUCUfr2XVqQg2HQbUuHWaZQyzYuHAvxUcK TnkA== X-Gm-Message-State: ALoCoQlJVY/6yQz4LKRdTH+6Nmvut1nfDH0wLz6QKgghXFZ6i5oKX8pZwHAnSEAwoW0xnPsBVxYP X-Received: by 10.194.83.169 with SMTP id r9mr432838wjy.6.1444235087589; Wed, 07 Oct 2015 09:24:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.29.148 with SMTP id d142ls80882lfd.27.gmail; Wed, 07 Oct 2015 09:24:47 -0700 (PDT) X-Received: by 10.25.151.65 with SMTP id z62mr719062lfd.21.1444235087422; Wed, 07 Oct 2015 09:24:47 -0700 (PDT) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com. [2a00:1450:4010:c04::22b]) by mx.google.com with ESMTPS id ax1si25806805lbc.156.2015.10.07.09.24.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Oct 2015 09:24:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22b as permitted sender) client-ip=2a00:1450:4010:c04::22b; Received: by lbbwt4 with SMTP id wt4so17675171lbb.1 for ; Wed, 07 Oct 2015 09:24:47 -0700 (PDT) X-Received: by 10.112.168.228 with SMTP id zz4mr1086190lbb.73.1444235086414; Wed, 07 Oct 2015 09:24:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp79064lbq; Wed, 7 Oct 2015 09:24:45 -0700 (PDT) X-Received: by 10.50.79.169 with SMTP id k9mr3008919igx.40.1444235085193; Wed, 07 Oct 2015 09:24:45 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x75si28132768ioi.11.2015.10.07.09.24.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Oct 2015 09:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-63755-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 105678 invoked by alias); 7 Oct 2015 16:23:38 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 105591 invoked by uid 89); 7 Oct 2015 16:23:37 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f177.google.com X-Received: by 10.129.133.195 with SMTP id v186mr1578419ywf.40.1444235012392; Wed, 07 Oct 2015 09:23:32 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Adhemerval Zanella Subject: [PATCH 07/13] nptl: x32: Fix Race conditions in pthread cancellation (BZ#12683) Date: Wed, 7 Oct 2015 13:23:09 -0300 Message-Id: <1444234995-9542-8-git-send-email-adhemerval.zanella@linaro.com> In-Reply-To: <1444234995-9542-1-git-send-email-adhemerval.zanella@linaro.com> References: <1444234995-9542-1-git-send-email-adhemerval.zanella@linaro.com> X-Original-Sender: adhemerval.zanella@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22b as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 From: Adhemerval Zanella This patches adds the x32 modification required for the BZ#12683 fix. It basically adjust the syscall size used to pass the arguments to the syscall cancel wrappers. Checked on x32. * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (__syscall_arg_t): Define type for x32. (__SSC): Add platform specific macro. --- ChangeLog | 4 ++++ sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 54dfca3..b71c168 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-10-07 Adhemerval Zanella + * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (__syscall_arg_t): + Define type for x32. + (__SSC): Add platform specific macro. + * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Remove file. * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: Remove file. * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: Remove file. diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h index 2324168..f2dc8f0 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h @@ -18,6 +18,27 @@ #ifndef _LINUX_X32_SYSDEP_H #define _LINUX_X32_SYSDEP_H 1 +#ifndef __ASSEMBLER__ +#include + +typedef long long int __syscall_arg_t; + +/* Syscall arguments for x32 follows x86_64 size, however pointers are 32 + bits in size. This suppress the GCC warning "cast from pointer to + integer of different size" when calling __syscall_cancel with + pointer as arguments. */ +# define __SSC(__x) \ + ({ \ + __syscall_arg_t __ret; \ + DIAG_PUSH_NEEDS_COMMENT; \ + DIAG_IGNORE_NEEDS_COMMENT (4.7, "-Wpointer-to-int-cast"); \ + __ret = (sizeof(1 ? (__x) : 0ULL) < 8 ? \ + (unsigned long int) (__x) : (long long int) (__x)); \ + DIAG_POP_NEEDS_COMMENT; \ + __ret; \ + }) +#endif + /* There is some commonality. */ #include #include