From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Adhemerval Zanella Newsgroups: gmane.comp.lib.glibc.alpha Subject: [PATCH v2 13/21] nptl: m68k: Fix Race conditions in pthread cancellation (BZ#12683) Date: Mon, 26 Feb 2018 18:03:28 -0300 Message-ID: <1519679016-12241-14-git-send-email-adhemerval.zanella@linaro.org> References: <1519679016-12241-1-git-send-email-adhemerval.zanella@linaro.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1519679057 17875 195.159.176.226 (26 Feb 2018 21:04:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Feb 2018 21:04:17 +0000 (UTC) To: libc-alpha@sourceware.org Original-X-From: libc-alpha-return-90630-glibc-alpha=m.gmane.org@sourceware.org Mon Feb 26 22:04:13 2018 Return-path: Envelope-to: glibc-alpha@blaine.gmane.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=Nv4D4ANlKAPnBraQK4h7tIo3nnfDYm8 dhELAw29u56iSeEoIEaJi0/uw2/jAMkuf0nIVwWOTQNq/WpCIlSridKatJ3h+3+I zG5JOqAO19tMNlCN2FiInAeWdVfXVVJxxB90TszvA9zq1Ibh9W4XSljcfVYBufH0 9zMHppYWR54Y= 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=VUO53K1ELUulmR6GDJVVl0L2Gkw=; b=iiGli xVI/LZl9Qe9RhW12Os6+tbdz1/a1CoFyhYbMrACItr9cOVnje/K8jQ3x4ErV6343 ffvR4B7a02VeNMPsbP0K1Vp5k8fqrtSpoDgtW+pkKYhDD0RFXYnVkopIpwvYqXUb w5/DOmVhj9JK1ONgr1DSfYA/NCJaDaNUN8Bv1E= 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: , Original-Sender: libc-alpha-owner@sourceware.org Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2208, 0002 X-HELO: mail-qk0-f193.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=5G4t+OFEO1NvZp5Gn83xbqY8FcxTZ/wHvoWIDSR+aCk=; b=MkAzVzw0XTUuWwluhap5dL5zeWgKElPoySBX5/DBJfq4Lov358GT0hOkuVNco9PzV1 aHhLoC2dW+v38nRdnAwJWGb449EPS+Vr/4ZAVdQiypHTUUf8XvZsJIdwqcTCcr/7POFu 34IuyTPKsrcAFcOH7oCpGSb94cfer7Oz2swg0Jg0ymLUN6H659Nhzfsja/4Gyo8ivaTa /tjrAgcJoxZUYuWnVbzfGZGXXOZUxN5jbt1Qa7p9pGhsZ92+1y2FAh0qNDWx/RQPISyv 8xSYwxpNqV3YgWfd9nN5mM3ytAMLNE8XmPn6y3ZR/KR904KbNP5iBwZbjK+YstjtnASo b6tQ== X-Gm-Message-State: APf1xPCCycH5U08aWtu9H20/g4yvCPy1bcDvtEanv5mJj9kFib1wrlDD SeUKoz7AD6544OXAH/aKPFEwyUx4w3Q= X-Google-Smtp-Source: AG47ELsgKSHS1DKmR07Q9RN8Ix4XrRRPSdyrZ2RHU0cEGwZ46/VQ8dGgYBdTSWwrXHqgjR3Ccu32Ww== X-Received: by 10.55.207.82 with SMTP id e79mr15192467qkj.219.1519679044051; Mon, 26 Feb 2018 13:04:04 -0800 (PST) In-Reply-To: <1519679016-12241-1-git-send-email-adhemerval.zanella@linaro.org> Xref: news.gmane.org gmane.comp.lib.glibc.alpha:82962 Archived-At: Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqPwP-0003u6-T3 for glibc-alpha@blaine.gmane.org; Mon, 26 Feb 2018 22:04:10 +0100 Received: (qmail 77595 invoked by alias); 26 Feb 2018 21:04:12 -0000 Received: (qmail 76886 invoked by uid 89); 26 Feb 2018 21:04:07 -0000 This patch adds the m68k modifications required for the BZ#12683. It basically adds the required ucontext_get_pc function The default syscall_cancel.c should is as expected for m68k with GCC 6.2.1. It generates the following code for syscall_cancel.os: --- 00000000 <__GI___syscall_cancel_arch>: 0: 4e56 0000 linkw %fp,#0 4: 48e7 3c00 moveml %d2-%d5,%sp@- 00000008 <__syscall_cancel_arch_start>: 8: 206e 0008 moveal %fp@(8),%a0 c: 2010 movel %a0@,%d0 e: 0800 0002 btst #2,%d0 12: 6628 bnes 3c <__syscall_cancel_arch_end+0xa> 14: 206e 0024 moveal %fp@(36),%a0 18: 2a2e 0020 movel %fp@(32),%d5 1c: 282e 001c movel %fp@(28),%d4 20: 262e 0018 movel %fp@(24),%d3 24: 242e 0014 movel %fp@(20),%d2 28: 222e 0010 movel %fp@(16),%d1 2c: 202e 000c movel %fp@(12),%d0 30: 4e40 trap #0 00000032 <__syscall_cancel_arch_end>: 32: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 38: 4e5e unlk %fp 3a: 4e75 rts 3c: 61ff 0000 0000 bsrl 3e <__syscall_cancel_arch_end+0xc> --- Checked against a build and make check run-built-tests=no for m68k-linux-gnu. [BZ #12683] * sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h (ucontext_get_pc): New function. --- ChangeLog | 4 ++++ sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h b/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h index 58374ed..3a288ea 100644 --- a/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h +++ b/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h @@ -16,6 +16,11 @@ License along with the GNU C Library. If not, see . */ +#ifndef _SIGCONTEXTINFO_H +#define _SIGCONTEXTINFO_H + +#include + #define SIGCONTEXT int _code, struct sigcontext * #define SIGCONTEXT_EXTRA_ARGS _code, #define GET_PC(ctx) ((void *) (ctx)->sc_pc) @@ -23,3 +28,11 @@ #define GET_STACK(ctx) ((void *) (ctx)->sc_usp) #define CALL_SIGHANDLER(handler, signo, ctx) \ (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) + +static inline uintptr_t +ucontext_get_pc (const ucontext_t *uc) +{ + return uc->uc_mcontext.gregs[R_PC]; +} + +#endif /* _SIGCONTEXTINFO_H */ -- 2.7.4