linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: Restrict ARM64_BTI_KERNEL to clang 12.0.0 and newer
@ 2021-07-09  0:06 Nathan Chancellor
  2021-07-12 12:24 ` Will Deacon
  2021-07-12 21:46 ` [PATCH v2] " Nathan Chancellor
  0 siblings, 2 replies; 6+ messages in thread
From: Nathan Chancellor @ 2021-07-09  0:06 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Nick Desaulniers, linux-arm-kernel, linux-kernel,
	clang-built-linux, Nathan Chancellor

Commit 97fed779f2a6 ("arm64: bti: Provide Kconfig for kernel mode BTI")
disabled CONFIG_ARM64_BTI_KERNEL when CONFIG_GCOV_KERNEL was enabled and
compilign with clang because of warnings that occur because LLVM was not
emitting PAC/BTI instructions for compiler generated functions.

This was an adequate fix to avoid the warnings with allmodconfig until
commit 51c2ee6d121c ("Kconfig: Introduce ARCH_WANTS_NO_INSTR and
CC_HAS_NO_PROFILE_FN_ATTR"), which prevented CONFIG_GCOV_KERNEL from
being selected with clang 12.0.0 and older because it does not support
the no_profile_instrument_function attribute. As a result,
CONFIG_ARM64_BTI_KERNEL gets enabled and there are more warnings of this
nature.

Rather than play whack-a-mole with the config options, just update this
condition to require clang 12.0.0, which should have all of the issues
ironed out.

Link: https://github.com/ClangBuiltLinux/linux/issues/1428
Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/3010034706?check_suite_focus=true
Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/3010035725?check_suite_focus=true
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/arm64/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index e07e7de9ac49..c2127595980f 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1605,7 +1605,8 @@ config ARM64_BTI_KERNEL
 	depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
 	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697
 	depends on !CC_IS_GCC || GCC_VERSION >= 100100
-	depends on !(CC_IS_CLANG && GCOV_KERNEL)
+	# https://reviews.llvm.org/D85649
+	depends on !CC_IS_CLANG || CLANG_VERSION >= 120000
 	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
 	help
 	  Build the kernel with Branch Target Identification annotations

base-commit: f55966571d5eb2876a11e48e798b4592fa1ffbb7
-- 
2.32.0.93.g670b81a890


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-13 18:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09  0:06 [PATCH] arm64: Restrict ARM64_BTI_KERNEL to clang 12.0.0 and newer Nathan Chancellor
2021-07-12 12:24 ` Will Deacon
2021-07-12 17:04   ` Nick Desaulniers
2021-07-12 21:46 ` [PATCH v2] " Nathan Chancellor
2021-07-12 23:15   ` Nick Desaulniers
2021-07-13 18:08   ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).