Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2144474rwb; Fri, 11 Nov 2022 05:45:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ZscDpJYwIL3+paU4lh6Am021NVC2D824tH6N5aJGgGy1qdxk6Jq0XiR59PCxWZ47I2BMn X-Received: by 2002:a17:90a:b288:b0:20c:9d98:13f4 with SMTP id c8-20020a17090ab28800b0020c9d9813f4mr1976005pjr.87.1668174351421; Fri, 11 Nov 2022 05:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668174351; cv=none; d=google.com; s=arc-20160816; b=iJO01vaQ1i84WIeoB/BiVrX3/bK2Xclu2mPJR7NEwFB+qGDan9I2hXCI32tBP/NTPG dvDCyvNxgZUq4QfFvUb3URJCOio0CWfyxyLysm6jYJpYVAxTkdRwO1/f0AlSYlWQrT4/ iGs/wlbkgOECuyY1WQpsIc1kmq+hzFpWGqWxfOIidlc4uqcp9AvZwR7Gko8wOf76xW+F 5RrCV8WKGIHjt8i2U6vQiUhfqjahh9d1uNvBanFDAQQU5Y4536jfpv6YGiPBLIp71m1e Er/9slAPbPoR+ioIbJNZMXcDB+SbHJ2Hc0diD8QI7ujuXehZBNNm7IBldNhidg0OJu2X 2S+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=R9NampiiSMKLSSmXuEmnCPvbPvMSsZ0OOOLZvcX7tOk=; b=V0hpLWKew0Sq4/Ui6N/FPxjmaGuwdo4hqbe0aPwiIML4t+qNGxkjonvybYGAY5gVgN bVPyGnY/6uyXjwWrxs7M1fVhn0Eo6onKEVikn8vbD67C239kdwrf4FoQj2KUJMc+d4GG YNOfgJ/sf2CEZlOo+sU+8EmHlgqO8yr1Q3dUJbJr+kJRJrcwLoiCh0aHSiKUYLJ2Klmp HCvKLHtghJ97aDejWRbT8ZsFXd4t3tLo/Z6uxum2V9SJyzYuESpeOJ+HcXeJY3Q0aq86 pUbR5IVz68bNfGMMqQ4MLhMR0giUMkYeV/goNUJ800aJeVvO+FubNCN5qefEGgwCoaza 2J2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sKDywg44; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a635908000000b0044034f3a27bsi2563454pgb.101.2022.11.11.05.45.38; Fri, 11 Nov 2022 05:45:51 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sKDywg44; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233730AbiKKN3I (ORCPT + 91 others); Fri, 11 Nov 2022 08:29:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbiKKN3G (ORCPT ); Fri, 11 Nov 2022 08:29:06 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9241117420 for ; Fri, 11 Nov 2022 05:29:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1848D61FCC for ; Fri, 11 Nov 2022 13:29:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D4AFC433D6; Fri, 11 Nov 2022 13:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668173344; bh=fJkVku6UihzNOl7Dkq+EJ1F1NQcd6o7T8PJpq+a6u5g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sKDywg44dWfWS34cuxFh2R+d8reKj6AAmR+3qlaY6swdV51HNKHp+6M9vHfazxesc VXWaNscBPQrXju75qN7wfO36mSmKfTYyfakG67pbF5XPiHRJ9luWIXKAiqdRTJ8dBv isWNKb+00FIIvfGZGUjNfDBrN1oD1CPNPWrovOfXpx1JcwJXc70jZyc/rceRSUmsvO hUG+6+VIy/fM8Jq9qvjtK5AhvMVJQi/8XIHJo6o2EYoAX4ClqChrkok2J7aif9RxVf TYjoD+UXI/JnK6xIy3+dUDNWE0APcH0FM00vLxDVcvfcIf+RqZt7HftsVKx4iUygc4 cQYtGy3GWN0fg== Date: Fri, 11 Nov 2022 22:29:00 +0900 From: Masami Hiramatsu (Google) To: Sami Tolvanen Cc: Peter Zijlstra , Mark Rutland , 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: <20221111222900.0e4a1d4768730b9784249c86@kernel.org> In-Reply-To: <20221109192831.3057131-1-samitolvanen@google.com> References: <20221109192831.3057131-1-samitolvanen@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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, 9 Nov 2022 19:28:31 +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 This looks good to me. Reviewed-by: Masami Hiramatsu (Google) Thanks! > --- > 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 > -- Masami Hiramatsu (Google)