Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2450833rwb; Fri, 11 Nov 2022 09:26:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf4k9XVCn2byDgjs+YquWmfwoJ2B/+jxp7lHOAkN9BQ6a13EjSx7Z5gjWqWnS8UzorPwQucW X-Received: by 2002:aa7:da99:0:b0:467:31d1:9aa8 with SMTP id q25-20020aa7da99000000b0046731d19aa8mr2349344eds.215.1668187585796; Fri, 11 Nov 2022 09:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668187585; cv=none; d=google.com; s=arc-20160816; b=CcnRB2olJ14K3hO02/tdXBZY3fFNzzUpYzQoKaoEZYej2BEbwCucu9n2YJbC3WypnV mPmaTSkflbwCFNRgkUSnq8vn7d8E0fbSWm1zeTZjJEYDxROezT85N8jfxUPMiaGRp456 i5fS3o11PcjhG3BcUiY5uGNBvGsdEsnt/BAm6TxfNqTKF4Y0cgwcTWK4YHBix1vqMC9E r/siOQs9Gu/eN8Td2W+YL7zBoZg4iZo/oIyDJHfE6T/5R4ur1688yn+2cbt3/+ymCuUg BITBiZVpJSlYOTTWk/XjWRkLbS96SL0R56NPhukCVP1Y0XqZUgLAIa6XFIn1aAgqJFX7 Cs3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=At/93GcJaxr8DDrQcOW/ZTMCfZU0UTGXFloX0QQ75a0=; b=L/j3mr+nhfhemL5rXl5iSBz/1XVwN7+fUNzkFfHeeFgeYlF7ibKfmDraThMAMhoWeQ YGtQpYlNB9f7yRYhTd2+Cip7rNA9Cm64yPnd/2QRShoUHd4Qv885aCggW/tuJTd+6WYz bb8FZT1Ww0YIFMpTQ4h0Hb3kouWVedWldwtI9XqjaOyAV6D9u9eh1gaBz8aTZKivKzmN fUNnhGlweKWnrakPOERnsHO9RNk9DZX+o/a103bOSAYwwkKA2kIsnnQp/lXndhpO8Tk7 Nv8KgTvFyackC+XkMcefkuSArMgyRR2rGCveiiDEtpGQ0EeJsbST2B/wU4qMbtDyfTTc 8Y7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a50d4d9000000b0046109fd5943si2418541edj.544.2022.11.11.09.26.02; Fri, 11 Nov 2022 09:26:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233674AbiKKQJm (ORCPT + 91 others); Fri, 11 Nov 2022 11:09:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbiKKQJk (ORCPT ); Fri, 11 Nov 2022 11:09:40 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8A36659FE2 for ; Fri, 11 Nov 2022 08:09:39 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7F5101FB; Fri, 11 Nov 2022 08:09:45 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.25.147]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07DEF3F73D; Fri, 11 Nov 2022 08:09:37 -0800 (PST) Date: Fri, 11 Nov 2022 16:09:19 +0000 From: Mark Rutland To: Sami Tolvanen Cc: Peter Zijlstra , Catalin Marinas , Will Deacon , Steven Rostedt , Masami Hiramatsu , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER Message-ID: References: <20221109192831.3057131-1-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221109192831.3057131-1-samitolvanen@google.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 09, 2022 at 07:28:31PM +0000, Sami Tolvanen wrote: > The 0-day bot reports that arm64 builds with CONFIG_CFI_CLANG + > CONFIG_FTRACE are broken when CONFIG_FUNCTION_GRAPH_TRACER is not > enabled: > > ld.lld: error: undefined symbol: __kcfi_typeid_ftrace_stub_graph > >>> referenced by entry-ftrace.S:299 (arch/arm64/kernel/entry-ftrace.S:299) > >>> arch/arm64/kernel/entry-ftrace.o:(.text+0x48) in archive vmlinux.a > > This is caused by ftrace_stub_graph using SYM_TYPE_FUNC_START when > the address of the function is not taken in any C translation unit. > > Fix the build by only defining ftrace_stub_graph when it's actually > needed, i.e. with CONFIG_FUNCTION_GRAPH_TRACER. > > Link: https://lore.kernel.org/lkml/202210251659.tRMs78RH-lkp@intel.com/ > Fixes: 883bbbffa5a4 ("ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph()") > Reported-by: kernel test robot > Signed-off-by: Sami Tolvanen Acked-by: Mark Rutland Mark. > --- > arch/arm64/kernel/entry-ftrace.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S > index 795344ab4ec4..322a831f8ede 100644 > --- a/arch/arm64/kernel/entry-ftrace.S > +++ b/arch/arm64/kernel/entry-ftrace.S > @@ -299,11 +299,11 @@ SYM_TYPED_FUNC_START(ftrace_stub) > ret > SYM_FUNC_END(ftrace_stub) > > +#ifdef CONFIG_FUNCTION_GRAPH_TRACER > SYM_TYPED_FUNC_START(ftrace_stub_graph) > ret > SYM_FUNC_END(ftrace_stub_graph) > > -#ifdef CONFIG_FUNCTION_GRAPH_TRACER > /* > * void return_to_handler(void) > * > > base-commit: f141df371335645ce29a87d9683a3f79fba7fd67 > -- > 2.38.1.431.g37b22c650d-goog >