Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5127836yba; Wed, 10 Apr 2019 11:59:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRnlkkzK6/TC+Je/7XBv8Ftr0TRGUVKDQhiaz4NZ7ky5+68CtqAoezfXTUocmvMOcggjzQ X-Received: by 2002:a62:62c3:: with SMTP id w186mr13199880pfb.73.1554922752412; Wed, 10 Apr 2019 11:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554922752; cv=none; d=google.com; s=arc-20160816; b=vpVugPDa+3DKJzvaBCjY54/d6UJOd7VAAQwtttqw/5WayVd3VEmaAeTlgSnB7Y5JqB WeDq89Psp9JU8cfDmmEi1Mb7Ab4Kb6ayItdcqnYIjgvGC3W26aTVNKp4dUrdqVjqZivp Qrvuo82D2GFkZWL7bTMkgwD6V1OTnwQnYcrBwcDm8Xlil6MkaDYBaCerG+AfiwvfUqOe Z4jkn5V8EhRD7K1YWHZSGRI2lpX7A+v4DyMJvNquaXor0q3iOPE0zvjJi3pNUUDVvuQh iY6EeHXDnevA7leOYfBf9Biz9PiPBbAYISHSxSBeK82vnm8PavEQJmrsgoGGYMHkaMep BL5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Xck+WtEZPt1Qhi4NY+PflBcXuHbOwBHygRvzCwsXXgI=; b=QlUetIpzk4zmmkjdMvezZcRiU7F43/Nt0RxFTNIgDC4iIqeRNDALTcSD1XN9qnjcJy u8dQ3Cm1Fj2HbUgBaBH7o0SZFNEFcJzEE+jxo4OMkktSPPuGNRQ0DwQzyQygAcQrbs57 9WnnPBosOb3i73GR2Az33kXn6s2SbR095VhzzpOnj6hx1rn6uDLvcMw19aazk/JqxaD7 laGGyEQhYhNtgQlewSmM+LxOzPstGCDZSX5iYF75adViY1mftANpT3vB4BPRkrKr8/zu 6Vs0ilYA1INIZ0i9dM2JuQMJEZJxFwro3RZBVOSPqXF0pXg8UytChK49Go3IoBiSdW21 SyVw== 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 u192si14253998pgc.282.2019.04.10.11.58.56; Wed, 10 Apr 2019 11:59:12 -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 S1731665AbfDJQOZ (ORCPT + 99 others); Wed, 10 Apr 2019 12:14:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:48230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729048AbfDJQOY (ORCPT ); Wed, 10 Apr 2019 12:14:24 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E07762082E; Wed, 10 Apr 2019 16:14:22 +0000 (UTC) Date: Wed, 10 Apr 2019 12:14:21 -0400 From: Steven Rostedt To: Martin Schwidefsky Cc: Arnd Bergmann , Heiko Carstens , Ingo Molnar , clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , linux-s390@vger.kernel.org, Vasily Gorbik , linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/12] s390: avoid __builtin_return_address(n) on clang Message-ID: <20190410121421.1414e179@gandalf.local.home> In-Reply-To: <20190410180357.3290d24f@mschwideX1> References: <20190408212648.2407234-1-arnd@arndb.de> <20190408212648.2407234-10-arnd@arndb.de> <20190410180357.3290d24f@mschwideX1> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) -- Steve