From patchwork Fri Oct 7 21:11:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 679749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3srMdl0xCvz9sBr for ; Sat, 8 Oct 2016 08:11:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B240933CA5; Fri, 7 Oct 2016 21:11:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eXo1o3Bw-2-s; Fri, 7 Oct 2016 21:11:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2D0BB3108A; Fri, 7 Oct 2016 21:11:35 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 54A281C2D59 for ; Fri, 7 Oct 2016 21:11:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 50E2AC2DA3 for ; Fri, 7 Oct 2016 21:11:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vZRYZBrxOO14 for ; Fri, 7 Oct 2016 21:11:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.synopsys.com (us01smtprelay-2.synopsys.com [198.182.60.111]) by fraxinus.osuosl.org (Postfix) with ESMTPS id B13A7C2D9A for ; Fri, 7 Oct 2016 21:11:32 +0000 (UTC) Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id C20F810C11E1; Fri, 7 Oct 2016 14:11:31 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id A4D4B55F13; Fri, 7 Oct 2016 14:11:31 -0700 (PDT) Received: from mailhost.synopsys.com (unknown [10.13.184.66]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 7C93855F02; Fri, 7 Oct 2016 14:11:31 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 6CCAC700; Fri, 7 Oct 2016 14:11:31 -0700 (PDT) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1.internal.synopsys.com [10.12.239.235]) by mailhost.synopsys.com (Postfix) with ESMTP id 217D06FF; Fri, 7 Oct 2016 14:11:31 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by us01wehtc1.internal.synopsys.com (10.12.239.231) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 7 Oct 2016 14:11:30 -0700 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.266.1; Sat, 8 Oct 2016 02:41:29 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.10.161.39) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.266.1; Sat, 8 Oct 2016 02:41:29 +0530 From: Vineet Gupta To: Subject: [PATCH 1/2] ARC: nptl: cancellable wrappers were broken Date: Fri, 7 Oct 2016 14:11:16 -0700 Message-ID: <1475874677-28945-1-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.10.161.39] Cc: Alexey Brodkin , uclibc@uclibc.org, Vineet Gupta , linux-snps-arc@lists.infradead.org, Eugeniy Paltsev X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: "uClibc" This was reported as uClicb test suite failures of tst-mqueue3, tst-mqueue5 The syscall args were getting clobbered, so use scratch regs which are not used for syscall args 00002690 : ; SINGLE_THREAD_P 2690: sub r1,r25,0x448 <--- clobers r1, r2 2698: ld r2,[r1] 269c: cmp r2,0 26a0: bz mq_timedsend_nocancel ; DOCARGS (saves syscall args but r1, r2 clobbered already) 26a4: st.aw blink,[sp,-4] 26a8: st.aw r0,[sp,-4] 26ac: st.aw r1,[sp,-4] 26b0: st.aw r2,[sp,-4] 26b4: st.aw r3,[sp,-4] 26b8: st.aw r4,[sp,-4] 26bc: bl 1e28 <__librt_enable_asynccancel> Reported-by: Eugeniy Paltsev Cc: Alexey Brodkin Signed-off-by: Vineet Gupta --- libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h index cddd754a8680..918f61d67548 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h @@ -99,9 +99,9 @@ #define UNDOCARGS_7 pop r6` UNDOCARGS_6 # define SINGLE_THREAD_P \ - THREAD_SELF r1 ` \ - ld r2, [r1, MULTIPLE_THREADS_OFFSET]` \ - cmp r2, 0 + THREAD_SELF r9 ` \ + ld r10, [r9, MULTIPLE_THREADS_OFFSET]` \ + cmp r10, 0 /* ld r2, [r1, -TLS_PRE_TCB_SIZE + MULTIPLE_THREADS_OFFSET] */ #else /* !__ASSEMBLER__ */