Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5139637yba; Wed, 10 Apr 2019 12:13:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhW9bh21LtYWArDb3H+NebqUnL5sulWX/Hntehbyc2SCksl8z5+Uz9XSTcymJOSWmMmGbN X-Received: by 2002:a65:4108:: with SMTP id w8mr42441925pgp.236.1554923616203; Wed, 10 Apr 2019 12:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554923616; cv=none; d=google.com; s=arc-20160816; b=sJ1x4deK0ewBwb3B2DbGVdATrWNFPvzwmLsgl0a61W2gFljI+UHjLA54zOVn8toRc8 cxdi7N+e/TbTvZvClbPKwNRy1161urHXxM0qUH+MzDU6ZfQVLa0J8c0tWzGHO1gs3TWR 4bwjXPZCL9YMl2mGNb7+DGnmAc1JIP/2vtAK3Y2Kxsy/+vrVfCM3Z1NvvgN8SKwRifU3 JMYJDsX5+U2zvqYlndd7ZbK10y4hYxZ6ZZJQKMv7cBR7yuut2fSvyoJnTRmBr0i1lOgg aCv1CScYIPi69bzJ00BIRt1YUTpp6fcH0dUjS/cS1MGnOirELWDIVitWZkof40lg2fCP R5ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=qnbLwH6iGLNRvl8vt0nxZoX+YWDkW7NPpWgoHprpoZE=; b=0AYEsTfYzl4SWHr6yG/tgoSjV7ZODKbyB07YkxJ5bgt0ZLH1OVOAfk3TCRstAgVumC gfhmh/6srQOFm+lEaHqKqD73sfj5UrOclqzoPKLU/okI0w8JYIJzkpKDmAjzX/PKiQ8o Tl+vYLVjJYRNthxz8e1SNtEaIPewxz3g1WogqDXAuJNP+5sHKMINCI5e/o3orZba9fCq rszgFhYYvPDA43FP28b407M/hSzeCTexFVK6wiN39FPw3NG8X5sFPTdpq/R8rbgF1QgX nLjx7ZJnkMcApCI1q4z6WvMJWTQHfD9/ZIv6TSb5sJ+GeGVp1EN+EP308aFy+PyDSUDX tSZw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si32787502pfe.250.2019.04.10.12.13.20; Wed, 10 Apr 2019 12:13:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbfDJTIO (ORCPT + 99 others); Wed, 10 Apr 2019 15:08:14 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:44606 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726690AbfDJTIN (ORCPT ); Wed, 10 Apr 2019 15:08:13 -0400 Received: by mail-qk1-f193.google.com with SMTP id y5so1915536qkc.11; Wed, 10 Apr 2019 12:08:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qnbLwH6iGLNRvl8vt0nxZoX+YWDkW7NPpWgoHprpoZE=; b=nbg6cD295rAqKq3caEgXuNBtl3cjzOeVWQ5eX8azWIkPPa3Ojl7WZktP80FPqVNU9I z3Ik1OL2aIHajgy39QTxYrqBO5WVVN1tp6HvtQrSi9vlxMjZX+K+FUlXJKy66Zr7kaa9 8zVJib7i43KZiboVZuuVnykaljnx+QEMdbjwUpX9gcriDtoIBlCrniNz0vWDUk4WYi6n Ff9j4fgtifXKp9Iessk4chPG8ChMy/oBtIxXtm6acvkzn0eB+Uy/HyGrUaWllESueBRO M88/MW2v/DVI0G8RcPhCujSSUuZBdRTWihCflgVgJmRA0XUr1IuLJTRnl9i+OqNfqGFd YQXw== X-Gm-Message-State: APjAAAWFEZrOu/aDjP2y7hCpuWrQ2Phk2TYihHNzJgJyu1CxckpRf+rc Nc8nSJ6zAumJ6HpxU5Gl3jliHFDOfoL8KuFf2tX6DGz2 X-Received: by 2002:a05:620a:148d:: with SMTP id w13mr36134612qkj.6.1554923292709; Wed, 10 Apr 2019 12:08:12 -0700 (PDT) MIME-Version: 1.0 References: <20190408212648.2407234-1-arnd@arndb.de> <20190408212648.2407234-10-arnd@arndb.de> <20190410180357.3290d24f@mschwideX1> <20190410121421.1414e179@gandalf.local.home> In-Reply-To: <20190410121421.1414e179@gandalf.local.home> From: Arnd Bergmann Date: Wed, 10 Apr 2019 21:07:56 +0200 Message-ID: Subject: Re: [PATCH 10/12] s390: avoid __builtin_return_address(n) on clang To: Steven Rostedt Cc: Martin Schwidefsky , Heiko Carstens , Ingo Molnar , clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , linux-s390 , Vasily Gorbik , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Arnd