From patchwork Wed Mar 29 09:22:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 744666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vtMkk1QR1z9s1h for ; Wed, 29 Mar 2017 20:23:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="DTD7poFb"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; q=dns; s=default; b=sSrPpOmnbTRnjWOPMQ0GVsEeRib81Jx Az6sFeBbAWSzW5KN2xZ0Hxa9Je51fwM77ykh+2F3r+hylzcFYQ7kN6i7LrcE17YT ddWyDc4qYpAZYAnkuG4BgG+K6j1tseW2Vf3je+bIF5vONVqa15x7+4Cg4OO4t14z luZwm2vL+RkE= 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:to:from:subject:date:mime-version:content-type :message-id; s=default; bh=LR0lFIysI0mFx13k7oVPv2e/Buk=; b=DTD7p oFbkmzhWp00AZouDxynTrOb3W5V3/wbDhoDcpF7UeJYzWnyP1naP2ILDz30bVHpc CjWw+X3t1C+/MY710tPMGQOxhbp8ihA14p90ehVc9TuflVy4n2msYdzY8Kgag0PX O+6fR1duZd+w8J8Zfq0JOXkImb6RC+cN/YsKW8= Received: (qmail 16320 invoked by alias); 29 Mar 2017 09:23:01 -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 15951 invoked by uid 89); 29 Mar 2017 09:23:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com To: libc-alpha@sourceware.org From: Stefan Liebler Subject: [PATCH] S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit. Date: Wed, 29 Mar 2017 11:22:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17032909-0012-0000-0000-000004F7EA2F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032909-0013-0000-0000-000017D0D67E Message-Id: <876ee185-e900-6442-393f-8619cc55d76f@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-29_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703290079 Hi, This patch also clobbers r14 in TLS_LD, TLS_GD macros on 31bit. This ensures that r14 isn't used to save and restore r12 while r14 is clobbered by the bas-instruction. As note: r12 can't be clobbered as gcc would fail with: error: PIC register clobbered by ‘12’ in ‘asm’ For 64bit this fix was already done in 2004 in the commit b80af23ac6973e69df6cd23d221fa44fffb21e17. Bye Stefan ChangeLog: * sysdeps/s390/s390-32/tls-macros.h (TLS_LD, TLS_GD): Clobber also r14. commit 3f102d08af514c1cd4094c2feaca02546548de36 Author: Stefan Liebler Date: Wed Mar 29 11:07:02 2017 +0200 S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit. This patch also clobbers r14 in TLS_LD, TLS_GD macros on 31bit. This ensures that r14 isn't used to save and restore r12 while r14 is clobbered by the bas-instruction. As note: r12 can't be clobbered as gcc would fail with: error: PIC register clobbered by ‘12’ in ‘asm’ For 64bit this fix was already done in 2004 in the commit b80af23ac6973e69df6cd23d221fa44fffb21e17. ChangeLog: * sysdeps/s390/s390-32/tls-macros.h (TLS_LD, TLS_GD): Clobber also r14. diff --git a/sysdeps/s390/s390-32/tls-macros.h b/sysdeps/s390/s390-32/tls-macros.h index 09b42aa..a4c5fff 100644 --- a/sysdeps/s390/s390-32/tls-macros.h +++ b/sysdeps/s390/s390-32/tls-macros.h @@ -47,7 +47,7 @@ "alr %0,%%r2\n\t" \ "lr %%r12,%1" \ : "=&a" (__offset), "=&a" (__save12) \ - : : "cc", "0", "1", "2", "3", "4", "5" ); \ + : : "cc", "0", "1", "2", "3", "4", "5", "14"); \ (int *) (__builtin_thread_pointer() + __offset); }) #else # define TLS_LD(x) \ @@ -63,7 +63,8 @@ "bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \ "l %0,12(%0)\n\t" \ "alr %0,%%r2" \ - : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \ + : "=&a" (__offset) \ + : : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \ (int *) (__builtin_thread_pointer() + __offset); }) #endif @@ -83,7 +84,7 @@ "lr %0,%%r2\n\t" \ "lr %%r12,%1" \ : "=&a" (__offset), "=&a" (__save12) \ - : : "cc", "0", "1", "2", "3", "4", "5" ); \ + : : "cc", "0", "1", "2", "3", "4", "5", "14"); \ (int *) (__builtin_thread_pointer() + __offset); }) #else # define TLS_GD(x) \ @@ -97,6 +98,7 @@ "l %%r2,8(%0)\n\t" \ "bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \ "lr %0,%%r2" \ - : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \ + : "=&a" (__offset) \ + : : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \ (int *) (__builtin_thread_pointer() + __offset); }) #endif