From patchwork Thu Sep 17 20:04:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 53845 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id BDE0F22E57 for ; Thu, 17 Sep 2015 20:04:48 +0000 (UTC) Received: by lamf6 with SMTP id f6sf11410798lam.1 for ; Thu, 17 Sep 2015 13:04: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:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-subscribe:list-archive:list-post:list-help :sender:delivered-to:from:subject:to:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding :x-original-sender:x-original-authentication-results; bh=aOXILA5P58ZmMD4y3abEf0+jt5XlR7prj3K8v8lYpGY=; b=Di9GR/QDoNFIC1XZwE2lY8TdbwWfCOmGn31P2u2zjc8i2DGu0EtMLsqd8TTVhPsK+3 YZ3sxuZ4Vnm1lnLVfaCGdXgZ1hm/SY69nazVzyKRsWohLZxqJchfJDGfn6gTwTseeDj0 ayWtX07bIbnNwzaTNApYAkTyY2WMwIw8pKqrX4B4qY2lrYyECbOPog2AkEs+a2dCU3WJ u3Ndr7Z+9Uz0hrKWnUi4ZhErE7eIwbyWmYPigZNhVYT7lo7K21PQHWsT/JfY1eYqSuMU whFxYvIeLR9/dMqI1VmfWzeHYKAMnHe6YAk1H/aRXfG8OWQ1i+vf1J+Yb4hbCM4zHy4G L1pQ== X-Gm-Message-State: ALoCoQmlh76jyjeAW7Dq3ZLMyWrCjqNygfkVEc2xk+AlzZctcBZI7RM3RAg6RRdo8fKKygdgm6Cy X-Received: by 10.194.115.135 with SMTP id jo7mr164788wjb.7.1442520287675; Thu, 17 Sep 2015 13:04:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.161.234 with SMTP id xv10ls147289lab.51.gmail; Thu, 17 Sep 2015 13:04:47 -0700 (PDT) X-Received: by 10.112.158.70 with SMTP id ws6mr1255580lbb.28.1442520287319; Thu, 17 Sep 2015 13:04:47 -0700 (PDT) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com. [2a00:1450:4010:c03::233]) by mx.google.com with ESMTPS id xh2si3327144lbb.130.2015.09.17.13.04.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 13:04:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::233 as permitted sender) client-ip=2a00:1450:4010:c03::233; Received: by lanb10 with SMTP id b10so18098505lan.3 for ; Thu, 17 Sep 2015 13:04:47 -0700 (PDT) X-Received: by 10.112.199.70 with SMTP id ji6mr1164705lbc.73.1442520287208; Thu, 17 Sep 2015 13:04:47 -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 w3csp3264915lbq; Thu, 17 Sep 2015 13:04:46 -0700 (PDT) X-Received: by 10.66.236.129 with SMTP id uu1mr1715840pac.34.1442520286086; Thu, 17 Sep 2015 13:04:46 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id of6si7624701pbc.54.2015.09.17.13.04.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 13:04:46 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-63261-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 106883 invoked by alias); 17 Sep 2015 20:04:25 -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 106816 invoked by uid 89); 17 Sep 2015 20:04:24 -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-f171.google.com X-Received: by 10.129.43.134 with SMTP id r128mr1195759ywr.9.1442520257366; Thu, 17 Sep 2015 13:04:17 -0700 (PDT) From: Adhemerval Zanella Subject: [PATCH 04/10] nptl: x32: Fix Race conditions in pthread cancellation (BZ#12683) To: GNU C Library Message-ID: <55FB1CC1.8060007@linaro.org> Date: Thu, 17 Sep 2015 17:04:17 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 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:c03::233 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 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. --- * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (__syscall_arg_t): Define type for x32. (__SSC): Add platform specific macro. -- 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