All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/percpu: Re-enable named address spaces with KASAN for GCC 13.3+
@ 2024-03-20 12:45 Uros Bizjak
  2024-03-20 13:33 ` [tip: x86/percpu] " tip-bot2 for Uros Bizjak
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2024-03-20 12:45 UTC (permalink / raw
  To: x86, linux-kernel
  Cc: Uros Bizjak, Ingo Molnar, Andy Lutomirski, Brian Gerst,
	Denys Vlasenko, H . Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Josh Poimboeuf

Commit 68fb3ca0e408 ("x86/percpu: Disable named address spaces for
KASAN") disabled support for named address spaces with KASAN due to
the incompatibility issue between named AS and KASAN.

GCC 13.3 has fixed this issue (GCC PR sanitizer/111736) so the
support for named address spaces can be re-enabled with KASAN
for GCC compiler version >= 13.3.

Note that the patch considers GCC 14 to be fixed - if somebody is
using snapshots of the GCC 14 before the fix, they should upgrade.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
---
 arch/x86/Kconfig | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7aed87cbf386..09455d93b947 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2435,14 +2435,17 @@ endmenu
 config CC_HAS_NAMED_AS
 	def_bool CC_IS_GCC && GCC_VERSION >= 120100
 
+config CC_HAS_NAMED_AS_FIXED_ASAN
+	def_bool CC_IS_GCC && GCC_VERSION >= 130300
+
 config USE_X86_SEG_SUPPORT
 	def_bool y
 	depends on CC_HAS_NAMED_AS
 	#
-	# -fsanitize=kernel-address (KASAN) is at the moment incompatible
-	# with named address spaces - see GCC PR sanitizer/111736.
+	# -fsanitize=kernel-address (KASAN) is incompatible with named
+	# address spaces with GCC < 13.3 - see GCC PR sanitizer/111736.
 	#
-	depends on !KASAN
+	depends on !KASAN || CC_HAS_NAMED_AS_FIXED_ASAN
 
 config CC_HAS_SLS
 	def_bool $(cc-option,-mharden-sls=all)
-- 
2.44.0


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

* [tip: x86/percpu] x86/percpu: Re-enable named address spaces with KASAN for GCC 13.3+
  2024-03-20 12:45 [PATCH] x86/percpu: Re-enable named address spaces with KASAN for GCC 13.3+ Uros Bizjak
@ 2024-03-20 13:33 ` tip-bot2 for Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Uros Bizjak @ 2024-03-20 13:33 UTC (permalink / raw
  To: linux-tip-commits
  Cc: Uros Bizjak, Ingo Molnar, Andy Lutomirski, Josh Poimboeuf,
	Linus Torvalds, Ard Biesheuvel, Jakub Jelinek, Nick Desaulniers,
	Sean Christopherson, x86, linux-kernel

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

Commit-ID:     f61f02d1ff788ae5ad485ef8edd88d9c93557994
Gitweb:        https://git.kernel.org/tip/f61f02d1ff788ae5ad485ef8edd88d9c93557994
Author:        Uros Bizjak <ubizjak@gmail.com>
AuthorDate:    Wed, 20 Mar 2024 13:45:49 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 20 Mar 2024 14:22:56 +01:00

x86/percpu: Re-enable named address spaces with KASAN for GCC 13.3+

Commit:

  68fb3ca0e408 ("x86/percpu: Disable named address spaces for KASAN")

... disabled support for named address spaces with KASAN due to
the incompatibility issue between named AS and KASAN.

GCC 13.3 has fixed this issue (GCC PR sanitizer/111736) so the
support for named address spaces can be re-enabled with KASAN
for GCC compiler version >= 13.3.

Note that the patch considers GCC 14 to be fixed - if somebody is
using snapshots of the GCC 14 before the fix, they should upgrade.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20240320124603.566923-1-ubizjak@gmail.com
---
 arch/x86/Kconfig |  9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7aed87c..09455d9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2435,14 +2435,17 @@ endmenu
 config CC_HAS_NAMED_AS
 	def_bool CC_IS_GCC && GCC_VERSION >= 120100
 
+config CC_HAS_NAMED_AS_FIXED_ASAN
+	def_bool CC_IS_GCC && GCC_VERSION >= 130300
+
 config USE_X86_SEG_SUPPORT
 	def_bool y
 	depends on CC_HAS_NAMED_AS
 	#
-	# -fsanitize=kernel-address (KASAN) is at the moment incompatible
-	# with named address spaces - see GCC PR sanitizer/111736.
+	# -fsanitize=kernel-address (KASAN) is incompatible with named
+	# address spaces with GCC < 13.3 - see GCC PR sanitizer/111736.
 	#
-	depends on !KASAN
+	depends on !KASAN || CC_HAS_NAMED_AS_FIXED_ASAN
 
 config CC_HAS_SLS
 	def_bool $(cc-option,-mharden-sls=all)

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

end of thread, other threads:[~2024-03-20 13:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20 12:45 [PATCH] x86/percpu: Re-enable named address spaces with KASAN for GCC 13.3+ Uros Bizjak
2024-03-20 13:33 ` [tip: x86/percpu] " tip-bot2 for Uros Bizjak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.