[tip: x86/percpu] x86/percpu: Enable named address spaces with known compiler version

From: tip-bot2 for Uros Bizjak
Date: Thu Oct 05 2023 - 12:19:03 EST


The following commit has been merged into the x86/percpu branch of tip:

Commit-ID: 1ca3683cc6d2c2ce4204df519c4e4730d037905a
Gitweb: https://git.kernel.org/tip/1ca3683cc6d2c2ce4204df519c4e4730d037905a
Author: Uros Bizjak <ubizjak@xxxxxxxxx>
AuthorDate: Wed, 04 Oct 2023 16:49:42 +02:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Thu, 05 Oct 2023 09:01:52 +02:00

x86/percpu: Enable named address spaces with known compiler version

Enable named address spaces with known compiler versions
(GCC 12.1 and later) in order to avoid possible issues with named
address spaces with older compilers. Set CC_HAS_NAMED_AS when the
compiler satisfies version requirements and set USE_X86_SEG_SUPPORT
to signal when segment qualifiers could be used.

Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxx>
Cc: Brian Gerst <brgerst@xxxxxxxxx>
Cc: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
Cc: H. Peter Anvin <hpa@xxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20231004145137.86537-3-ubizjak@xxxxxxxxx
---
arch/x86/Kconfig | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 982b777..ecb2569 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2388,6 +2388,13 @@ source "kernel/livepatch/Kconfig"

endmenu

+config CC_HAS_NAMED_AS
+ def_bool CC_IS_GCC && GCC_VERSION >= 120100
+
+config USE_X86_SEG_SUPPORT
+ def_bool y
+ depends on CC_HAS_NAMED_AS && SMP
+
config CC_HAS_SLS
def_bool $(cc-option,-mharden-sls=all)