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 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 DFF56D6395B for ; Wed, 20 Nov 2024 14:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tovYO3m6brSWWbiBOidu7qU1W0jAZlplACbqVb1YvNs=; b=CX5KkA3ReZqFvmSmWoaVIwzkOr Xfu3eo0Hzr+wPh3rSIlpvOpP+MUPliaUy/U/MVuWsPEgIYUPrfWj56+0istZiQVgHFdQFXxsIUzS/ 5Lhu/Nn98mGpVP85TyEukt+wIrv6bdnEXr5q00wqcgkf6DMYIGtaDSrExbkar1yxoy/prn8uLzeV4 12VitWSHavGDXZD1M7+MX7s0M6W1MQlWDz5ruChJKqao1b6OvCCZA/ECNWjpW55a/NN3DqMwdx8a0 R4xivghbw2XSLYKPBMKj/xj8PRPkS0yDwpVa9W0TGTv7zQafa+ODw/I7bP1vb0NXKyg0eMNqh26Bz 4IqlSlFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDlPN-0000000FUub-3Bza; Wed, 20 Nov 2024 14:10:17 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDlMM-0000000FUCE-22DL for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2024 14:07:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 08A235C5405; Wed, 20 Nov 2024 14:06:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F412C4CECD; Wed, 20 Nov 2024 14:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732111629; bh=DKek5Oayrz6LgCVAqEw5i/CoZsCQVMoEfVXkm5eofCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mqygtr3l3eWWP8FDKFms99Z0wp+XfGQ5Ptxjh9k+ID/EYoE5I8ooKjj7FJY9H2yPo /2pf7jrPFNVubG0S3F40Xs4TeOEcC33Mt4lGgDThx+vUgyBWRu3bD/wJjwz5kA0Py5 Xy6Qs83cPHAq35sJ1T3iS7NUXrezMMlgqh8OJY8l5mMS/OBy3bpPvb5ZtiMtEWGFs9 dnonGJL1DdDgPAbblbLv6v0IaJtEoS9EV6/7CPdd4AYUyJ0bVnklOScSQc6WD3AsZ1 jxRobYgyisDx4MVyyhjZVuT/jz8mp7IjNH15OK+xQcVd7CajoGCuWMoA+dH/ekHZtZ +VX4KNxK0Nuig== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Linus Walleij , kernel test robot , Nathan Chancellor , Russell King , Sasha Levin , linux@armlinux.org.uk, arnd@arndb.de, samitolvanen@google.com, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Subject: [PATCH AUTOSEL 6.6 5/6] ARM: 9434/1: cfi: Fix compilation corner case Date: Wed, 20 Nov 2024 09:06:35 -0500 Message-ID: <20241120140647.1768984-5-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241120140647.1768984-1-sashal@kernel.org> References: <20241120140647.1768984-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.62 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241120_060710_565605_644A8D0B X-CRM114-Status: GOOD ( 11.89 ) 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 From: Linus Walleij [ Upstream commit 4aea16b7cfb76bd3361858ceee6893ef5c9b5570 ] When enabling expert mode CONFIG_EXPERT and using that power user mode to disable the branch prediction hardening !CONFIG_HARDEN_BRANCH_PREDICTOR, the assembly linker in CLANG notices that some assembly in proc-v7.S does not have corresponding C call sites, i.e. the prototypes in proc-v7-bugs.c are enclosed in ifdef CONFIG_HARDEN_BRANCH_PREDICTOR so this assembly: SYM_TYPED_FUNC_START(cpu_v7_smc_switch_mm) SYM_TYPED_FUNC_START(cpu_v7_hvc_switch_mm) Results in: ld.lld: error: undefined symbol: __kcfi_typeid_cpu_v7_smc_switch_mm >>> referenced by proc-v7.S:94 (.../arch/arm/mm/proc-v7.S:94) >>> arch/arm/mm/proc-v7.o:(.text+0x108) in archive vmlinux.a ld.lld: error: undefined symbol: __kcfi_typeid_cpu_v7_hvc_switch_mm >>> referenced by proc-v7.S:105 (.../arch/arm/mm/proc-v7.S:105) >>> arch/arm/mm/proc-v7.o:(.text+0x124) in archive vmlinux.a Fix this by adding an additional requirement that CONFIG_HARDEN_BRANCH_PREDICTOR has to be enabled to compile these assembly calls. Closes: https://lore.kernel.org/oe-kbuild-all/202411041456.ZsoEiD7T-lkp@intel.com/ Reported-by: kernel test robot Reviewed-by: Nathan Chancellor Signed-off-by: Linus Walleij Signed-off-by: Russell King (Oracle) Signed-off-by: Sasha Levin --- arch/arm/mm/proc-v7.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 193c7aeb67039..bea11f9bfe856 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -93,7 +93,7 @@ ENTRY(cpu_v7_dcache_clean_area) ret lr ENDPROC(cpu_v7_dcache_clean_area) -#ifdef CONFIG_ARM_PSCI +#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) .arch_extension sec ENTRY(cpu_v7_smc_switch_mm) stmfd sp!, {r0 - r3} -- 2.43.0