diff mbox series

arm64: kconfig: Update and comment GCC version check for kernel BTI

Message ID 20200512115458.4985-1-will@kernel.org (mailing list archive)
State Mainlined
Commit 3a88d7c5c9448d24785ce862334bde2d5dc39aca
Headers show
Series arm64: kconfig: Update and comment GCC version check for kernel BTI | expand

Commit Message

Will Deacon May 12, 2020, 11:54 a.m. UTC
Some versions of GCC are known to suffer from a BTI code generation bug,
meaning that CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI cannot be solely used
to determine whether or not we can compile with kernel with BTI enabled.

Update the BTI Kconfig entry to refer to the relevant GCC bugzilla entry
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697) and update the check
now that the fix has been merged into GCC release 10.1.

Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
---
 arch/arm64/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Brown May 12, 2020, noon UTC | #1
On Tue, May 12, 2020 at 12:54:58PM +0100, Will Deacon wrote:
> Some versions of GCC are known to suffer from a BTI code generation bug,
> meaning that CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI cannot be solely used
> to determine whether or not we can compile with kernel with BTI enabled.
> 
> Update the BTI Kconfig entry to refer to the relevant GCC bugzilla entry
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697) and update the check
> now that the fix has been merged into GCC release 10.1.

Acked-by: Mark Brown <broonie@kernel.org>

There wasn't a GCC 10.0 release, I was a little surprised at the
numbering of the initial GCC 10 release.
diff mbox series

Patch

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 77d5fa96f9d0..e058854bcefc 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1616,7 +1616,8 @@  config ARM64_BTI_KERNEL
 	depends on ARM64_BTI
 	depends on ARM64_PTR_AUTH
 	depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
-	depends on !CC_IS_GCC || GCC_VERSION >= 100000
+	# 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)
 	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
 	help