From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B8FCC433EF for ; Wed, 17 Nov 2021 19:26:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E689861BB6 for ; Wed, 17 Nov 2021 19:26:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E689861BB6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=myPKLjcrMvULlkXIG6jiUD8kJXdZZHRVGc0WXHyuYMc=; b=nVqwwPklvHiDru e3rBYKzIFhoe2TA3ShvvT0mZ9F5qBqE6qF6XIt+PEv6IW9Zcb1zr4AMsKrIbvZ93F0O01t6V8piFe dnpVpcxkFZmrVRcOSMLBrE4c64FRzGAi+l87wYUhd/qwV4mdPa0xG+PdY/63aE4OB0Lod3tAG7gpx f5LCOTEYZBM33ZXX8YD3R9dqs8QrUkM+qkAUz0J+zDqO8ovFTJ2hVE8kd01bLfE0FVlHW0hyCBufe fSVprY5WMRBXmGjaftyu40mc6I2bsbHxraVBaJNxOkf5eB+Pb3wBbHPJ4nd0LVG+FhwQw2FSrvpxl DIf2oXPoRLisijT7kPLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnQY9-0069HJ-EL; Wed, 17 Nov 2021 19:24:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnQY5-0069Gf-Gl for linux-arm-kernel@lists.infradead.org; Wed, 17 Nov 2021 19:24:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id ACFB261AFF; Wed, 17 Nov 2021 19:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637177088; bh=LC222xu+7xfflnayL11gn1WvsJC/DZjkauLm9wox4QU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OBGaQK89STeJBz76SH+6SWvGWgf6ur9C78zONVOmuDdNTzX14Xd0xdQVLdwKDnhxI 4okbhqg9ZeiRum+gdX+m6DCVj5aaJLIhiLPeWfCfXDNSwgz4F7kiGznidJY44IgFFe ApuZRh7SyXXSotY8sYiMvUIay7T9cnSyhfbFvwVZM1u6bqXXEItKfO3m18tiFa/A5P 2buoD8IJoVaR3md2/IFBfS1XxdZWHL7RJDP4G9c2fBPXtcKMiuSMrEPbxmFmohKl0c 4mrbb9CH877/VDN4GgUaXPxgKAOCESY0bi2n01mPZX+Q1gkLKOrhYG2yLJ+uELhrYI hvZB+n7pe8exw== Date: Wed, 17 Nov 2021 12:24:43 -0700 From: Nathan Chancellor To: Marc Zyngier Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, Greg Kroah-Hartman , Mark Rutland , Daniel Lezcano , Sami Tolvanen , Nick Desaulniers Subject: Re: [PATCH] clocksource/drivers/arm_arch_timer: Force inlining of erratum_set_next_event_generic() Message-ID: References: <20211117113532.3895208-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211117113532.3895208-1-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211117_112449_634288_2A434518 X-CRM114-Status: GOOD ( 22.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Nov 17, 2021 at 11:35:32AM +0000, Marc Zyngier wrote: > With some specific kernel configuration and Clang, the kernel fails > to like with something like: Specifically, CONFIG_CFI_CLANG=y from what I could tell from looking into this: https://github.com/ClangBuiltLinux/linux/issues/1503 > ld.lld: error: undefined symbol: __compiletime_assert_200 > >>> referenced by arch_timer.h:156 (./arch/arm64/include/asm/arch_timer.h:156) > >>> clocksource/arm_arch_timer.o:(erratum_set_next_event_generic) in archive drivers/built-in.a > > ld.lld: error: undefined symbol: __compiletime_assert_197 > >>> referenced by arch_timer.h:133 (./arch/arm64/include/asm/arch_timer.h:133) > >>> clocksource/arm_arch_timer.o:(erratum_set_next_event_generic) in archive drivers/built-in.a > make: *** [Makefile:1161: vmlinux] Error 1 > > These are due to the BUILD_BUG() macros contained in the low-level > accessors (arch_timer_reg_{write,read}_cp15) being emitted, as the > access type wasn't known at compile time. > > Fix this by making erratum_set_next_event_generic() __force_inline, > resulting in the 'access' parameter to be resolved at compile time, > similarly to what is already done for set_next_event(). > > Fixes: 4775bc63f880 ("Add build-time guards for unhandled register accesses") It looks like the prefix was removed? Shouldn't it be: Fixes: 4775bc63f880 ("clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses") > Reported-by: Greg Kroah-Hartman > Signed-off-by: Marc Zyngier > Cc: Mark Rutland > Cc: Daniel Lezcano > Cc: Sami Tolvanen > Cc: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > drivers/clocksource/arm_arch_timer.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c > index 9a04eacc4412..1ecd52f903b8 100644 > --- a/drivers/clocksource/arm_arch_timer.c > +++ b/drivers/clocksource/arm_arch_timer.c > @@ -394,8 +394,13 @@ EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround); > > static atomic_t timer_unstable_counter_workaround_in_use = ATOMIC_INIT(0); > > -static void erratum_set_next_event_generic(const int access, unsigned long evt, > - struct clock_event_device *clk) > +/* > + * Force the inlining of this function so that the register accesses > + * can be themselves correctly inlined. > + */ > +static __always_inline > +void erratum_set_next_event_generic(const int access, unsigned long evt, > + struct clock_event_device *clk) > { > unsigned long ctrl; > u64 cval; > -- > 2.30.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel