From patchwork Wed Nov 9 19:28:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 13037944 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 79C26C4332F for ; Wed, 9 Nov 2022 19:29:48 +0000 (UTC) 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:Cc:To:From:Subject:Message-ID: Mime-Version:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=+5utQWk9SMTqMh+GPciERYht5Kdunez/yMAHSZ1WrW8=; b=YsI r+9aSDk6OkvJ8/ZoEyfyoxh7j0vwBasvXvlskUptcUYaRp7T6A2tEe0g1Uufx48YykUNTNrco0/U6 bNX6GHrb5kUvZFoS1kuiVTPbxdemU2PH/xvjWnX++SSIgJjz4YgOtjMPfpJXmClZlQQfapXndtvHd B6oatrRgIHmrcFDg3FRVshqO/Jww8H11oqzlZSfTO8JP4yal/PvHb7LFpTQC0OTkChufOT4HsQBHV SeZaqVQsuhcrUM2qcGgAAHb8P28pHghneDINZKoA44X1y6PkxVExc6T/ynFWwpiR70zi5yYAYX5Xd TdrVHhAMeOT3ZWbaHZTn9CySSuvLdRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osqkZ-00GbL0-5Z; Wed, 09 Nov 2022 19:28:39 +0000 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osqkV-00GbJe-NP for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 19:28:37 +0000 Received: by mail-pl1-x649.google.com with SMTP id k9-20020a170902c40900b0018734e872a9so14185595plk.21 for ; Wed, 09 Nov 2022 11:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=uhn/izWbmyc6oJPM/ThsWZaC9OAu56s0DbZK1LlxeR0=; b=DIGqhVBczwt3BrX2ZjwcfG7CUyu3SftdoAUziC9Oc3LkXSqkFBpXU+j09vJsy1YS3k yj/Bsd+44LNWbXtNkti2tG/boBaK1iSNWJAre0DS89T+RZ1cUosoQB0ZuKh/JVGhLm4J hIy2sJTnbBQL7zCSlsMnOUlfbUx+pisd0SsEPoSfy6iuKfoRP8lM6noCGxdz+ooEcrR+ LHu3AtkKjuvdHOUxcATha0CTpmfZNvqKmui4iBvs3sAKn0gxPWK7NAqM0BsrsHVM6bmP t9QYauD2wfHzfS4+g3c0J/WBvgu/vELufbiXj6H14D05SIB2Peo8+9r9kI86Hfsrw00U ahBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uhn/izWbmyc6oJPM/ThsWZaC9OAu56s0DbZK1LlxeR0=; b=gUBbZcQuzX9j6d33eyVpk348y2eE7kptqWveBp45CjoSrUz7jcXzjBilzf6C1eemJY qiWf5MQ47lC9YXkf6bMXh7FDKDMh0f53jNeD7bnY0JAiwlBJKMdmW3e2y5W5EMkm/AAD UsAak76aP7wo2do1WBJG7VCZMOKfd6P/awVXIxT84rwtk565WpNrFwXbCGRFwXEPG2wi r/zN3+FoiwxXQr50mmd5iVtPjBwscfkw38fE7M28GYrtBdIM0wCYpZ89RXbO49uP5ban BuR5Y7FnKc5vJhbCrhQdMcL4KpNbyrfdWjyX2Di1wvbw2Mhr/htvUn++hQn5YrNtnz97 1ORQ== X-Gm-Message-State: ACrzQf09YaXpcu75Jp2SX6C/U47LxT2DCSMgt5JKzYHRTI0sMhwXch0b PkH5NxRzSZDfo4iVohvKXlMFTF0kSazcDhyjyOA= X-Google-Smtp-Source: AMsMyM7uHJUKuqxsR2zoKIJVOW/QBrkWsQuNpEo3NxnRhXuQr8I5NfDtJnaqqd6IVHZHFwmhk3jiEvuUFJng0GJpE3Y= X-Received: from samitolvanen.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:4f92]) (user=samitolvanen job=sendgmr) by 2002:a17:90a:6f62:b0:20a:7294:47dd with SMTP id d89-20020a17090a6f6200b0020a729447ddmr1175555pjk.207.1668022113175; Wed, 09 Nov 2022 11:28:33 -0800 (PST) Date: Wed, 9 Nov 2022 19:28:31 +0000 Mime-Version: 1.0 X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=1591; i=samitolvanen@google.com; h=from:subject; bh=VPKNPjkd/bF/wEZ6qVmao9Uypu73PRnyiFbtq1FB7vI=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBja/9f/3bT87oqAsZkcr4QGkPDCG2AvGyz2K6jyg+0 47dDtUqJAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCY2v/XwAKCRBMtfaEi7xW7s6bC/ 9LItMZNO3ztZbFyP3Si5LNRh3LFcMWxjZfi9X976rp+CBbyljWuWHFj1NbbR9dodRnn5DZYvSfx7FW /UO7zsgM6tH+ZYY+PxzFWQ57DM94ogVG9/z0OdSXGhicbC/qRQnRwjVD+B5c9GmW4WuiRUzpSSUXxK 7djx28X7DCxyz68eAO4so9WZWi/92bI7rXfsjKaG6aM9vb98CXPOSmtt7xVl7CXhCC2vMbpjOrJkqk tR0WFv7stefASbnMFAWC77TuPaTeR++tfsD7bw1394Yrnzt/LDLYZAwOyqYWH3NNgp8g/NWSHOLpVT SDc+T6t3KlcmvJ9lcPaHSb1kAONLaXXVjBT0SVxIAop+oJeaVaFHIjykffZR3QcWxHdjdkBvmzrZsS p0dK77UcnA14T8EpCV+tLNR3SsJQV35eeGZwLWwbgo9rAtLvCHJFS5dJs0+wrCMj/XeekoZ6iJzUZJ Qv/20nn4s+q/m7czC/fTZimFyxALUnu0N9PwNksjV3wgY= X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Message-ID: <20221109192831.3057131-1-samitolvanen@google.com> Subject: [PATCH] arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER From: Sami Tolvanen To: Peter Zijlstra , Mark Rutland , Catalin Marinas , Will Deacon Cc: Steven Rostedt , Masami Hiramatsu , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sami Tolvanen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221109_112835_790583_E5945F37 X-CRM114-Status: GOOD ( 13.13 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Masami Hiramatsu (Google) Acked-by: Mark Rutland Reviewed-by: Kees Cook --- arch/arm64/kernel/entry-ftrace.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: f141df371335645ce29a87d9683a3f79fba7fd67 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) *