Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5569557yba; Thu, 11 Apr 2019 00:33:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzos2vQktFtgtO+RQtzIe/QGVrGMN+F6RxpZSY+j1WGrrm7qV6ioeSc91+4tiCq5nHAEk1R X-Received: by 2002:a17:902:9004:: with SMTP id a4mr49380701plp.223.1554968014404; Thu, 11 Apr 2019 00:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554968014; cv=none; d=google.com; s=arc-20160816; b=Z7IXOSQch7iIIH/shpjWraRr9EQpy4/9jZzd3EvFmNYT8PVlJ8hpi3BB06tZIn8b5W ALlLtcQPjede4kMdL/+x2gijWmfMHhs3Afrd+QIYDY7DD/hUhbxHHW/5ckaahF68NOng EvQPHbwRGKOGcPNi60iC/F2BePa1/nkCLjljSu9q5gP5k/HiAc0Bir8k/7fGQPc+8RpE YkbVhuRdySY1V95iugJsObtcETuwvrG5eVRq/MHUYMpZL4WkiOTvriLhoiC5KVx+OL15 ij0dff9aEHFI5u9/KLNeknfB0MBv7YUjSVKZwwhaEs63NBC1FOgrLyyJv+/6ikfuOeCR 73ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:subject:cc:to:from:date; bh=Pkcy/H7RBay3qgd/vpwp1eq42UichxHRRC4dZJ9sIn8=; b=LOnZOccmlVn1c8Y1w7XfZtHn9TTMPEHYqYXt4Jy9X4fKYn6N4Hq2hzpfKNkZqgpsJu f6SGKEZzZJ/gxU0iyVrW2pc4GBIg0W+jOHUw7FZJxvvuJoi551KSk5sBp9zKRYhs0ekn ffQmLkLEEn3jtgqkiuSBt84jAWresh6dJbh4ueiW7+VNHKEal9BNBiqD3sZQ5/yduCQd vUe0ej+sQJj4GH8sT/Pxx1YH2P0D3JcoNuCSJqpPcO619BgEWtwlCl7+h1WjwVpo/E4Q buH8d6PgQCGxC7lV2tqCNrT3mjI5C4WbwMJNkvtvfMjov6MuLd6TqHMJea39tip5iMVy Lyog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si24911965plt.57.2019.04.11.00.33.18; Thu, 11 Apr 2019 00:33:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726755AbfDKHcn (ORCPT + 99 others); Thu, 11 Apr 2019 03:32:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57000 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbfDKHcn (ORCPT ); Thu, 11 Apr 2019 03:32:43 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3B7UFxS094717 for ; Thu, 11 Apr 2019 03:32:42 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rt10grtc6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 11 Apr 2019 03:32:41 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Apr 2019 08:32:39 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 11 Apr 2019 08:32:37 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3B7Waa353608620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Apr 2019 07:32:36 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0FCCE11C04A; Thu, 11 Apr 2019 07:32:36 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 955B911C054; Thu, 11 Apr 2019 07:32:35 +0000 (GMT) Received: from mschwideX1 (unknown [9.145.74.176]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 11 Apr 2019 07:32:35 +0000 (GMT) Date: Thu, 11 Apr 2019 09:32:34 +0200 From: Martin Schwidefsky To: Arnd Bergmann Cc: Steven Rostedt , Heiko Carstens , Ingo Molnar , clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , linux-s390 , Vasily Gorbik , Linux Kernel Mailing List Subject: Re: [PATCH 10/12] s390: avoid __builtin_return_address(n) on clang In-Reply-To: References: <20190408212648.2407234-1-arnd@arndb.de> <20190408212648.2407234-10-arnd@arndb.de> <20190410180357.3290d24f@mschwideX1> <20190410121421.1414e179@gandalf.local.home> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19041107-0012-0000-0000-0000030D9DB6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041107-0013-0000-0000-00002145C4A5 Message-Id: <20190411093234.5f212a2e@mschwideX1> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-11_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=897 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904110053 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Apr 2019 21:07:56 +0200 Arnd Bergmann wrote: > On Wed, Apr 10, 2019 at 6:14 PM Steven Rostedt wrote: > > On Wed, 10 Apr 2019 18:03:57 +0200 Martin Schwidefsky wrote: > > > > > > --- a/arch/s390/include/asm/ftrace.h > > > > +++ b/arch/s390/include/asm/ftrace.h > > > > @@ -13,7 +13,12 @@ > > > > > > > > #ifndef __ASSEMBLY__ > > > > > > > > +#ifdef CONFIG_CC_IS_CLANG > > > > +/* https://bugs.llvm.org/show_bug.cgi?id=41424 */ > > > > +#define ftrace_return_address(n) __builtin_return_address(0) > > > > +#else > > > > #define ftrace_return_address(n) __builtin_return_address(n) > > > > +#endif > > > > > > > > void _mcount(void); > > > > void ftrace_caller(void); > > > > > > I can say I like this one. If the compiler can not do __builtin_return_address(n) > > > it feels wrong to just use __builtin_return_address(0). > > > > I agree. The proper return value is 0UL, see include/linux/ftrace.h > > > > /* Archs may use other ways for ADDR1 and beyond */ > > #ifndef ftrace_return_address > > # ifdef CONFIG_FRAME_POINTER > > # define ftrace_return_address(n) __builtin_return_address(n) > > # else > > # define ftrace_return_address(n) 0UL > > # endif > > #endif > > > > This is why we treat zero differently: > > > > #define CALLER_ADDR0 ((unsigned long)ftrace_return_address0) > > #define CALLER_ADDR1 ((unsigned long)ftrace_return_address(1)) > > #define CALLER_ADDR2 ((unsigned long)ftrace_return_address(2)) > > #define CALLER_ADDR3 ((unsigned long)ftrace_return_address(3)) > > #define CALLER_ADDR4 ((unsigned long)ftrace_return_address(4)) > > #define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5)) > > #define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6)) > > Right, got it. > > Martin, do you want me to send a replacement patch, or can you > commit the patch with > > #ifdef CONFIG_CC_IS_CLANG > /* https://bugs.llvm.org/show_bug.cgi?id=41424 */ > #define ftrace_return_address(n) 0UL > #else > #define ftrace_return_address(n) __builtin_return_address(n) > #endif > > instead? Ok, done. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.