llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0
@ 2021-11-29 16:57 Nathan Chancellor
  2021-11-29 16:57 ` [PATCH RFC 1/6] Documentation: Raise the " Nathan Chancellor
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Nathan Chancellor @ 2021-11-29 16:57 UTC (permalink / raw)
  To: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann
  Cc: Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, linux-kernel, linux-kbuild, Nathan Chancellor

This patch series raises the minimum supported version of LLVM to
11.0.0.

Patch #1 outlines the issue, goes over the potential impact of the
change, and does the actual bump. Subsequent patches clean up the
various checks that are always true after the bump.

I have marked this revision as RFC to give various parties the option to
comment on this bump before it is done, namely KernelCI and Linaro's
LKFT, who are still testing clang-10. I have added some other folks to
CC that I know are testing with clang to see if this impacts them in any
way (as I would like to impact as few people as possible) but as far as
I am aware, most other CIs and developers are testing closer to tip of
tree. If that is not true, scream so that we can see what can be done
about that. If I missed anyone who is actively testing with clang,
please key them in and I will make sure to include them in future
revisions (if any are needed).

It probably makes sense for this series to live in -mm.

Nathan Chancellor (6):
  Documentation: Raise the minimum supported version of LLVM to 11.0.0
  mm, slab: Remove compiler check in __kmalloc_index
  arch/Kconfig: Remove CLANG_VERSION check in HAS_LTO_CLANG
  Revert "ARM: 9070/1: Make UNWINDER_ARM depend on ld.bfd or ld.lld
    11.0.0+"
  gcov: Remove compiler version check
  init/Kconfig: Drop linker version check for LD_ORPHAN_WARN

 Documentation/process/changes.rst | 2 +-
 arch/Kconfig                      | 3 +--
 arch/arm/Kconfig.debug            | 2 --
 include/linux/slab.h              | 3 +--
 init/Kconfig                      | 1 -
 kernel/gcov/Kconfig               | 1 -
 scripts/min-tool-version.sh       | 2 +-
 7 files changed, 4 insertions(+), 10 deletions(-)


base-commit: d58071a8a76d779eedab38033ae4c821c30295a5
-- 
2.34.1


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

* [PATCH RFC 1/6] Documentation: Raise the minimum supported version of LLVM to 11.0.0
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
@ 2021-11-29 16:57 ` Nathan Chancellor
  2021-11-29 16:57 ` [PATCH RFC 2/6] mm, slab: Remove compiler check in __kmalloc_index Nathan Chancellor
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Nathan Chancellor @ 2021-11-29 16:57 UTC (permalink / raw)
  To: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann
  Cc: Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, linux-kernel, linux-kbuild, Nathan Chancellor

LLVM versions prior to 11.0.0 have a harder time with dead code
elimination, which can cause issues with commonly used expressions such
as BUILD_BUG_ON and the bitmask functions/macros in bitfield.h (see the
first two issues links below).

Whenever there is an issue within LLVM that has been resolved in a later
release, the only course of action is to gate the problematic
configuration or source code on the toolchain verson or raise the
minimum supported version of LLVM for building the kernel, as LLVM has a
limited support lifetime compared to GCC. GCC major releases will
typically see a few point releases across a two year period on average
whereas LLVM major releases are only supported until the next major
release and will only see one or two point releases within that
timeframe. For example, GCC 8.1 was released in May 2018 and GCC 8.5 was
released in May 2021, whereas LLVM 12.0.0 was released in April 2021 and
its only point release, 12.0.1, was released in July 2021, giving a
minimal window for fixes to be backported.

To resolve these build errors around improper dead code elimination,
raise the minimum supported version of LLVM for building the kernel to
11.0.0. Doing so is a more proper solution than mucking around with core
kernel macros that have always worked with GCC or disabling drivers for
using these macros in a proper manner. This type of issue may continue
to crop up and require patching, which creates more debt for bumping the
minimum supported version in the future.

This should have a minimal impact to distributions. Using a script to
pull several different Docker images and check the output of
'clang --version':

archlinux:latest: clang version 13.0.0

debian:oldoldstable-slim: clang version 3.8.1-24 (tags/RELEASE_381/final)
debian:oldstable-slim: clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
debian:stable-slim: Debian clang version 11.0.1-2
debian:testing-slim: Debian clang version 11.1.0-4
debian:unstable-slim: Debian clang version 11.1.0-4

fedora:34: clang version 12.0.1 (Fedora 12.0.1-1.fc34)
fedora:latest: clang version 13.0.0 (Fedora 13.0.0-3.fc35)
fedora:rawhide: clang version 13.0.0 (Fedora 13.0.0-5.fc36)

opensuse/leap:15.2: clang version 9.0.1
opensuse/leap:latest: clang version 11.0.1
opensuse/tumbleweed:latest: clang version 13.0.0

ubuntu:bionic: clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
ubuntu:latest: clang version 10.0.0-4ubuntu1
ubuntu:hirsute: Ubuntu clang version 12.0.0-3ubuntu1~21.04.2
ubuntu:rolling: Ubuntu clang version 13.0.0-2
ubuntu:devel: Ubuntu clang version 13.0.0-9

In every case, the distribution's version of clang is either older than
the current minimum supported version of LLVM 10.0.1 or equal to or
greater than the proposed 11.0.0 so nothing should change.

Another benefit of this change is LLVM=1 works better with arm64 and
x86_64 since commit f12b034afeb3 ("scripts/Makefile.clang: default to
LLVM_IAS=1") enabled the integrated assembler by default, which only
works well with clang 11+ (clang-10 required it to be disabled to
successfully build a kernel).

Link: https://github.com/ClangBuiltLinux/linux/issues/1293
Link: https://github.com/ClangBuiltLinux/linux/issues/1506
Link: https://github.com/ClangBuiltLinux/linux/issues/1511
Link: https://github.com/llvm/llvm-project/commit/fa496ce3c6774097080c8a9cb808da56f383b938
Link: https://groups.google.com/g/clang-built-linux/c/mPQb9_ZWW0s/m/W7o6S-QTBAAJ
Link: https://github.com/ClangBuiltLinux/misc-scripts
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 Documentation/process/changes.rst | 2 +-
 scripts/min-tool-version.sh       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst
index b398b8576417..17182b537141 100644
--- a/Documentation/process/changes.rst
+++ b/Documentation/process/changes.rst
@@ -30,7 +30,7 @@ you probably needn't concern yourself with pcmciautils.
         Program        Minimal version       Command to check the version
 ====================== ===============  ========================================
 GNU C                  5.1              gcc --version
-Clang/LLVM (optional)  10.0.1           clang --version
+Clang/LLVM (optional)  11.0.0           clang --version
 GNU make               3.81             make --version
 binutils               2.23             ld -v
 flex                   2.5.35           flex --version
diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh
index 4edc708baa63..7c20252a90c6 100755
--- a/scripts/min-tool-version.sh
+++ b/scripts/min-tool-version.sh
@@ -28,7 +28,7 @@ llvm)
 	if [ "$SRCARCH" = s390 ]; then
 		echo 13.0.0
 	else
-		echo 10.0.1
+		echo 11.0.0
 	fi
 	;;
 *)
-- 
2.34.1


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

* [PATCH RFC 2/6] mm, slab: Remove compiler check in __kmalloc_index
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
  2021-11-29 16:57 ` [PATCH RFC 1/6] Documentation: Raise the " Nathan Chancellor
@ 2021-11-29 16:57 ` Nathan Chancellor
  2021-11-29 16:58 ` [PATCH RFC 3/6] arch/Kconfig: Remove CLANG_VERSION check in HAS_LTO_CLANG Nathan Chancellor
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Nathan Chancellor @ 2021-11-29 16:57 UTC (permalink / raw)
  To: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann
  Cc: Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, linux-kernel, linux-kbuild, Nathan Chancellor

The minimum supported version of LLVM has been raised to 11.0.0, meaning
this check is always true, so it can be dropped.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 include/linux/slab.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/slab.h b/include/linux/slab.h
index 181045148b06..d3fb5ac71c24 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -411,8 +411,7 @@ static __always_inline unsigned int __kmalloc_index(size_t size,
 	if (size <=  16 * 1024 * 1024) return 24;
 	if (size <=  32 * 1024 * 1024) return 25;
 
-	if ((IS_ENABLED(CONFIG_CC_IS_GCC) || CONFIG_CLANG_VERSION >= 110000)
-	    && !IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES) && size_is_constant)
+	if (!IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES) && size_is_constant)
 		BUILD_BUG_ON_MSG(1, "unexpected size in kmalloc_index()");
 	else
 		BUG();
-- 
2.34.1


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

* [PATCH RFC 3/6] arch/Kconfig: Remove CLANG_VERSION check in HAS_LTO_CLANG
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
  2021-11-29 16:57 ` [PATCH RFC 1/6] Documentation: Raise the " Nathan Chancellor
  2021-11-29 16:57 ` [PATCH RFC 2/6] mm, slab: Remove compiler check in __kmalloc_index Nathan Chancellor
@ 2021-11-29 16:58 ` Nathan Chancellor
  2021-11-29 16:58 ` [PATCH RFC 4/6] Revert "ARM: 9070/1: Make UNWINDER_ARM depend on ld.bfd or ld.lld 11.0.0+" Nathan Chancellor
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Nathan Chancellor @ 2021-11-29 16:58 UTC (permalink / raw)
  To: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann
  Cc: Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, linux-kernel, linux-kbuild, Nathan Chancellor

The minimum supported version of LLVM has been raised to 11.0.0, meaning
this check is always true, so it can be dropped.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index d3c4ab249e9c..86e071f693ce 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -648,8 +648,7 @@ config ARCH_SUPPORTS_LTO_CLANG_THIN
 
 config HAS_LTO_CLANG
 	def_bool y
-	# Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510
-	depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD && AS_IS_LLVM
+	depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
 	depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
 	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
 	depends on ARCH_SUPPORTS_LTO_CLANG
-- 
2.34.1


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

* [PATCH RFC 4/6] Revert "ARM: 9070/1: Make UNWINDER_ARM depend on ld.bfd or ld.lld 11.0.0+"
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
                   ` (2 preceding siblings ...)
  2021-11-29 16:58 ` [PATCH RFC 3/6] arch/Kconfig: Remove CLANG_VERSION check in HAS_LTO_CLANG Nathan Chancellor
@ 2021-11-29 16:58 ` Nathan Chancellor
  2021-11-29 16:58 ` [PATCH RFC 5/6] gcov: Remove compiler version check Nathan Chancellor
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Nathan Chancellor @ 2021-11-29 16:58 UTC (permalink / raw)
  To: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann
  Cc: Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, linux-kernel, linux-kbuild, Nathan Chancellor

This reverts commit 7411cfc3c91a08a884463bbc7623087ecc2efdd8.

The minimum supported version of LLVM has been raised to 11.0.0, meaning
this check is always true, so it can be dropped.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/arm/Kconfig.debug | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 98436702e0c7..cd2d74b625c1 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -66,8 +66,6 @@ config UNWINDER_FRAME_POINTER
 config UNWINDER_ARM
 	bool "ARM EABI stack unwinder"
 	depends on AEABI && !FUNCTION_GRAPH_TRACER
-	# https://github.com/ClangBuiltLinux/linux/issues/732
-	depends on !LD_IS_LLD || LLD_VERSION >= 110000
 	select ARM_UNWIND
 	help
 	  This option enables stack unwinding support in the kernel
-- 
2.34.1


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

* [PATCH RFC 5/6] gcov: Remove compiler version check
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
                   ` (3 preceding siblings ...)
  2021-11-29 16:58 ` [PATCH RFC 4/6] Revert "ARM: 9070/1: Make UNWINDER_ARM depend on ld.bfd or ld.lld 11.0.0+" Nathan Chancellor
@ 2021-11-29 16:58 ` Nathan Chancellor
  2021-11-29 16:58 ` [PATCH RFC 6/6] init/Kconfig: Drop linker version check for LD_ORPHAN_WARN Nathan Chancellor
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Nathan Chancellor @ 2021-11-29 16:58 UTC (permalink / raw)
  To: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann
  Cc: Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, linux-kernel, linux-kbuild, Nathan Chancellor

The minimum supported version of LLVM has been raised to 11.0.0, meaning
this check is always true, so it can be dropped.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 kernel/gcov/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig
index 053447183ac5..04f4ebdc3cf5 100644
--- a/kernel/gcov/Kconfig
+++ b/kernel/gcov/Kconfig
@@ -4,7 +4,6 @@ menu "GCOV-based kernel profiling"
 config GCOV_KERNEL
 	bool "Enable gcov-based kernel profiling"
 	depends on DEBUG_FS
-	depends on !CC_IS_CLANG || CLANG_VERSION >= 110000
 	depends on !ARCH_WANTS_NO_INSTR || CC_HAS_NO_PROFILE_FN_ATTR
 	select CONSTRUCTORS
 	default n
-- 
2.34.1


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

* [PATCH RFC 6/6] init/Kconfig: Drop linker version check for LD_ORPHAN_WARN
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
                   ` (4 preceding siblings ...)
  2021-11-29 16:58 ` [PATCH RFC 5/6] gcov: Remove compiler version check Nathan Chancellor
@ 2021-11-29 16:58 ` Nathan Chancellor
  2021-11-29 17:27 ` [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Miguel Ojeda
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Nathan Chancellor @ 2021-11-29 16:58 UTC (permalink / raw)
  To: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann
  Cc: Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, linux-kernel, linux-kbuild, Nathan Chancellor

The minimum supported version of LLVM has been raised to 11.0.0, meaning
this check is always true, so it can be dropped.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 init/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index 4b7bac10c72d..e40f967dee3f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1414,7 +1414,6 @@ config LD_DEAD_CODE_DATA_ELIMINATION
 config LD_ORPHAN_WARN
 	def_bool y
 	depends on ARCH_WANT_LD_ORPHAN_WARN
-	depends on !LD_IS_LLD || LLD_VERSION >= 110000
 	depends on $(ld-option,--orphan-handling=warn)
 
 config SYSCTL
-- 
2.34.1


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

* Re: [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
                   ` (5 preceding siblings ...)
  2021-11-29 16:58 ` [PATCH RFC 6/6] init/Kconfig: Drop linker version check for LD_ORPHAN_WARN Nathan Chancellor
@ 2021-11-29 17:27 ` Miguel Ojeda
  2021-11-29 17:56 ` Mark Brown
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Miguel Ojeda @ 2021-11-29 17:27 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann,
	Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, CKI Project,
	kernelci, llvm, linux-kernel, Linux Kbuild mailing list

On Mon, Nov 29, 2021 at 6:01 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> tree. If that is not true, scream so that we can see what can be done

The patches themselves look good to me. Let's see if somebody screams! :)

Reviewed-by: Miguel Ojeda <ojeda@kernel.org>

Cheers,
Miguel

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

* Re: [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
                   ` (6 preceding siblings ...)
  2021-11-29 17:27 ` [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Miguel Ojeda
@ 2021-11-29 17:56 ` Mark Brown
  2021-11-29 18:30 ` Nick Desaulniers
  2021-12-01 19:41 ` Kees Cook
  9 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2021-11-29 17:56 UTC (permalink / raw)
  To: kernelci, nathan
  Cc: Nick Desaulniers, Kees Cook, Andrew Morton, Arnd Bergmann,
	Masahiro Yamada, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	llvm, linux-kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

On Mon, Nov 29, 2021 at 09:57:57AM -0700, Nathan Chancellor wrote:
> This patch series raises the minimum supported version of LLVM to
> 11.0.0.
> 
> Patch #1 outlines the issue, goes over the potential impact of the
> change, and does the actual bump. Subsequent patches clean up the
> various checks that are always true after the bump.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
                   ` (7 preceding siblings ...)
  2021-11-29 17:56 ` Mark Brown
@ 2021-11-29 18:30 ` Nick Desaulniers
  2021-12-01 19:41 ` Kees Cook
  9 siblings, 0 replies; 14+ messages in thread
From: Nick Desaulniers @ 2021-11-29 18:30 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Kees Cook, Andrew Morton, Arnd Bergmann, Masahiro Yamada,
	Miguel Ojeda, Sami Tolvanen, Tom Stellard, Michael Ellerman,
	Naresh Kamboju, Jakub Kicinski, cki-project, kernelci, llvm,
	linux-kernel, linux-kbuild

On Mon, Nov 29, 2021 at 9:01 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> This patch series raises the minimum supported version of LLVM to
> 11.0.0.
>
> Patch #1 outlines the issue, goes over the potential impact of the
> change, and does the actual bump. Subsequent patches clean up the
> various checks that are always true after the bump.
>
> I have marked this revision as RFC to give various parties the option to
> comment on this bump before it is done, namely KernelCI and Linaro's
> LKFT, who are still testing clang-10. I have added some other folks to
> CC that I know are testing with clang to see if this impacts them in any
> way (as I would like to impact as few people as possible) but as far as
> I am aware, most other CIs and developers are testing closer to tip of
> tree. If that is not true, scream so that we can see what can be done
> about that. If I missed anyone who is actively testing with clang,
> please key them in and I will make sure to include them in future
> revisions (if any are needed).
>
> It probably makes sense for this series to live in -mm.

Series looks good to me. Thanks for the patch, and cleanups!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

>
> Nathan Chancellor (6):
>   Documentation: Raise the minimum supported version of LLVM to 11.0.0
>   mm, slab: Remove compiler check in __kmalloc_index
>   arch/Kconfig: Remove CLANG_VERSION check in HAS_LTO_CLANG
>   Revert "ARM: 9070/1: Make UNWINDER_ARM depend on ld.bfd or ld.lld
>     11.0.0+"
>   gcov: Remove compiler version check
>   init/Kconfig: Drop linker version check for LD_ORPHAN_WARN
>
>  Documentation/process/changes.rst | 2 +-
>  arch/Kconfig                      | 3 +--
>  arch/arm/Kconfig.debug            | 2 --
>  include/linux/slab.h              | 3 +--
>  init/Kconfig                      | 1 -
>  kernel/gcov/Kconfig               | 1 -
>  scripts/min-tool-version.sh       | 2 +-
>  7 files changed, 4 insertions(+), 10 deletions(-)
>
>
> base-commit: d58071a8a76d779eedab38033ae4c821c30295a5
> --
> 2.34.1
>
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0
  2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
                   ` (8 preceding siblings ...)
  2021-11-29 18:30 ` Nick Desaulniers
@ 2021-12-01 19:41 ` Kees Cook
  2021-12-02  8:26   ` Masahiro Yamada
  9 siblings, 1 reply; 14+ messages in thread
From: Kees Cook @ 2021-12-01 19:41 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Nick Desaulniers, Andrew Morton, Arnd Bergmann, Masahiro Yamada,
	Miguel Ojeda, Sami Tolvanen, Tom Stellard, Michael Ellerman,
	Naresh Kamboju, Jakub Kicinski, cki-project, kernelci, llvm,
	linux-kernel, linux-kbuild

On Mon, Nov 29, 2021 at 09:57:57AM -0700, Nathan Chancellor wrote:
> This patch series raises the minimum supported version of LLVM to
> 11.0.0.
> 
> Patch #1 outlines the issue, goes over the potential impact of the
> change, and does the actual bump. Subsequent patches clean up the
> various checks that are always true after the bump.
> 
> I have marked this revision as RFC to give various parties the option to
> comment on this bump before it is done, namely KernelCI and Linaro's
> LKFT, who are still testing clang-10. I have added some other folks to
> CC that I know are testing with clang to see if this impacts them in any
> way (as I would like to impact as few people as possible) but as far as
> I am aware, most other CIs and developers are testing closer to tip of
> tree. If that is not true, scream so that we can see what can be done
> about that. If I missed anyone who is actively testing with clang,
> please key them in and I will make sure to include them in future
> revisions (if any are needed).
> 
> It probably makes sense for this series to live in -mm.

Sounds good to me. Thanks!

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

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

* Re: [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0
  2021-12-01 19:41 ` Kees Cook
@ 2021-12-02  8:26   ` Masahiro Yamada
  2021-12-03 13:38     ` Marco Elver
  0 siblings, 1 reply; 14+ messages in thread
From: Masahiro Yamada @ 2021-12-02  8:26 UTC (permalink / raw)
  To: Kees Cook
  Cc: Nathan Chancellor, Nick Desaulniers, Andrew Morton,
	Arnd Bergmann, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, Linux Kernel Mailing List,
	Linux Kbuild mailing list

On Thu, Dec 2, 2021 at 4:41 AM Kees Cook <keescook@chromium.org> wrote:
>
> On Mon, Nov 29, 2021 at 09:57:57AM -0700, Nathan Chancellor wrote:
> > This patch series raises the minimum supported version of LLVM to
> > 11.0.0.
> >
> > Patch #1 outlines the issue, goes over the potential impact of the
> > change, and does the actual bump. Subsequent patches clean up the
> > various checks that are always true after the bump.
> >
> > I have marked this revision as RFC to give various parties the option to
> > comment on this bump before it is done, namely KernelCI and Linaro's
> > LKFT, who are still testing clang-10. I have added some other folks to
> > CC that I know are testing with clang to see if this impacts them in any
> > way (as I would like to impact as few people as possible) but as far as
> > I am aware, most other CIs and developers are testing closer to tip of
> > tree. If that is not true, scream so that we can see what can be done
> > about that. If I missed anyone who is actively testing with clang,
> > please key them in and I will make sure to include them in future
> > revisions (if any are needed).
> >
> > It probably makes sense for this series to live in -mm.
>
> Sounds good to me. Thanks!
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>
> --
> Kees Cook


Only positive feedback so far.

All applied to linux-kbuild.


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0
  2021-12-02  8:26   ` Masahiro Yamada
@ 2021-12-03 13:38     ` Marco Elver
  2021-12-03 15:51       ` Nathan Chancellor
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Elver @ 2021-12-03 13:38 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Kees Cook, Nathan Chancellor, Nick Desaulniers, Andrew Morton,
	Arnd Bergmann, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, Linux Kernel Mailing List,
	Linux Kbuild mailing list, glider

On Thu, Dec 02, 2021 at 05:26PM +0900, Masahiro Yamada wrote:
> On Thu, Dec 2, 2021 at 4:41 AM Kees Cook <keescook@chromium.org> wrote:
> >
> > On Mon, Nov 29, 2021 at 09:57:57AM -0700, Nathan Chancellor wrote:
> > > This patch series raises the minimum supported version of LLVM to
> > > 11.0.0.
[...]
> Only positive feedback so far.
> 
> All applied to linux-kbuild.

Some of the "dynamic" checks for compiler support unfortunately aren't
as easily grepable -- as far as I can tell, we can also include the
below, which would save us 2 cc-option invocations for all clang builds.

And just in case:

Acked-by: Marco Elver <elver@google.com>

for the rest as well.

Thanks,
-- Marco

------ >8 ------

From: Marco Elver <elver@google.com>
Date: Fri, 3 Dec 2021 14:18:44 +0100
Subject: [PATCH] Revert "ubsan, kcsan: Don't combine sanitizer with kcov on
 clang"

This reverts commit ea91a1d45d19469001a4955583187b0d75915759.

The minimum Clang version is now 11.0, which fixed the UBSAN/KCSAN vs.
KCOV incompatibilities.

Link: https://bugs.llvm.org/show_bug.cgi?id=45831
Signed-off-by: Marco Elver <elver@google.com>
---
 lib/Kconfig.kcsan | 11 -----------
 lib/Kconfig.ubsan | 12 ------------
 2 files changed, 23 deletions(-)

diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan
index e0a93ffdef30..b81454b2a0d0 100644
--- a/lib/Kconfig.kcsan
+++ b/lib/Kconfig.kcsan
@@ -10,21 +10,10 @@ config HAVE_KCSAN_COMPILER
 	  For the list of compilers that support KCSAN, please see
 	  <file:Documentation/dev-tools/kcsan.rst>.
 
-config KCSAN_KCOV_BROKEN
-	def_bool KCOV && CC_HAS_SANCOV_TRACE_PC
-	depends on CC_IS_CLANG
-	depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=thread -fsanitize-coverage=trace-pc)
-	help
-	  Some versions of clang support either KCSAN and KCOV but not the
-	  combination of the two.
-	  See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status
-	  in newer releases.
-
 menuconfig KCSAN
 	bool "KCSAN: dynamic data race detector"
 	depends on HAVE_ARCH_KCSAN && HAVE_KCSAN_COMPILER
 	depends on DEBUG_KERNEL && !KASAN
-	depends on !KCSAN_KCOV_BROKEN
 	select STACKTRACE
 	help
 	  The Kernel Concurrency Sanitizer (KCSAN) is a dynamic
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index e5372a13511d..31f38e7fe948 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -27,16 +27,6 @@ config UBSAN_TRAP
 	  the system. For some system builders this is an acceptable
 	  trade-off.
 
-config UBSAN_KCOV_BROKEN
-	def_bool KCOV && CC_HAS_SANCOV_TRACE_PC
-	depends on CC_IS_CLANG
-	depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=bounds -fsanitize-coverage=trace-pc)
-	help
-	  Some versions of clang support either UBSAN or KCOV but not the
-	  combination of the two.
-	  See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status
-	  in newer releases.
-
 config CC_HAS_UBSAN_BOUNDS
 	def_bool $(cc-option,-fsanitize=bounds)
 
@@ -46,7 +36,6 @@ config CC_HAS_UBSAN_ARRAY_BOUNDS
 config UBSAN_BOUNDS
 	bool "Perform array index bounds checking"
 	default UBSAN
-	depends on !UBSAN_KCOV_BROKEN
 	depends on CC_HAS_UBSAN_ARRAY_BOUNDS || CC_HAS_UBSAN_BOUNDS
 	help
 	  This option enables detection of directly indexed out of bounds
@@ -72,7 +61,6 @@ config UBSAN_ARRAY_BOUNDS
 config UBSAN_LOCAL_BOUNDS
 	bool "Perform array local bounds checking"
 	depends on UBSAN_TRAP
-	depends on !UBSAN_KCOV_BROKEN
 	depends on $(cc-option,-fsanitize=local-bounds)
 	help
 	  This option enables -fsanitize=local-bounds which traps when an
-- 
2.34.0.384.gca35af8252-goog


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

* Re: [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0
  2021-12-03 13:38     ` Marco Elver
@ 2021-12-03 15:51       ` Nathan Chancellor
  0 siblings, 0 replies; 14+ messages in thread
From: Nathan Chancellor @ 2021-12-03 15:51 UTC (permalink / raw)
  To: Marco Elver
  Cc: Masahiro Yamada, Kees Cook, Nick Desaulniers, Andrew Morton,
	Arnd Bergmann, Miguel Ojeda, Sami Tolvanen, Tom Stellard,
	Michael Ellerman, Naresh Kamboju, Jakub Kicinski, cki-project,
	kernelci, llvm, Linux Kernel Mailing List,
	Linux Kbuild mailing list, glider

On Fri, Dec 03, 2021 at 02:38:17PM +0100, Marco Elver wrote:
> On Thu, Dec 02, 2021 at 05:26PM +0900, Masahiro Yamada wrote:
> > On Thu, Dec 2, 2021 at 4:41 AM Kees Cook <keescook@chromium.org> wrote:
> > >
> > > On Mon, Nov 29, 2021 at 09:57:57AM -0700, Nathan Chancellor wrote:
> > > > This patch series raises the minimum supported version of LLVM to
> > > > 11.0.0.
> [...]
> > Only positive feedback so far.
> > 
> > All applied to linux-kbuild.
> 
> Some of the "dynamic" checks for compiler support unfortunately aren't
> as easily grepable -- as far as I can tell, we can also include the
> below, which would save us 2 cc-option invocations for all clang builds.
> 
> And just in case:
> 
> Acked-by: Marco Elver <elver@google.com>
> 
> for the rest as well.
> 
> Thanks,
> -- Marco
> 
> ------ >8 ------
> 
> From: Marco Elver <elver@google.com>
> Date: Fri, 3 Dec 2021 14:18:44 +0100
> Subject: [PATCH] Revert "ubsan, kcsan: Don't combine sanitizer with kcov on
>  clang"
> 
> This reverts commit ea91a1d45d19469001a4955583187b0d75915759.
> 
> The minimum Clang version is now 11.0, which fixed the UBSAN/KCSAN vs.
> KCOV incompatibilities.
> 
> Link: https://bugs.llvm.org/show_bug.cgi?id=45831
> Signed-off-by: Marco Elver <elver@google.com>

Thanks!

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  lib/Kconfig.kcsan | 11 -----------
>  lib/Kconfig.ubsan | 12 ------------
>  2 files changed, 23 deletions(-)
> 
> diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan
> index e0a93ffdef30..b81454b2a0d0 100644
> --- a/lib/Kconfig.kcsan
> +++ b/lib/Kconfig.kcsan
> @@ -10,21 +10,10 @@ config HAVE_KCSAN_COMPILER
>  	  For the list of compilers that support KCSAN, please see
>  	  <file:Documentation/dev-tools/kcsan.rst>.
>  
> -config KCSAN_KCOV_BROKEN
> -	def_bool KCOV && CC_HAS_SANCOV_TRACE_PC
> -	depends on CC_IS_CLANG
> -	depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=thread -fsanitize-coverage=trace-pc)
> -	help
> -	  Some versions of clang support either KCSAN and KCOV but not the
> -	  combination of the two.
> -	  See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status
> -	  in newer releases.
> -
>  menuconfig KCSAN
>  	bool "KCSAN: dynamic data race detector"
>  	depends on HAVE_ARCH_KCSAN && HAVE_KCSAN_COMPILER
>  	depends on DEBUG_KERNEL && !KASAN
> -	depends on !KCSAN_KCOV_BROKEN
>  	select STACKTRACE
>  	help
>  	  The Kernel Concurrency Sanitizer (KCSAN) is a dynamic
> diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
> index e5372a13511d..31f38e7fe948 100644
> --- a/lib/Kconfig.ubsan
> +++ b/lib/Kconfig.ubsan
> @@ -27,16 +27,6 @@ config UBSAN_TRAP
>  	  the system. For some system builders this is an acceptable
>  	  trade-off.
>  
> -config UBSAN_KCOV_BROKEN
> -	def_bool KCOV && CC_HAS_SANCOV_TRACE_PC
> -	depends on CC_IS_CLANG
> -	depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=bounds -fsanitize-coverage=trace-pc)
> -	help
> -	  Some versions of clang support either UBSAN or KCOV but not the
> -	  combination of the two.
> -	  See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status
> -	  in newer releases.
> -
>  config CC_HAS_UBSAN_BOUNDS
>  	def_bool $(cc-option,-fsanitize=bounds)
>  
> @@ -46,7 +36,6 @@ config CC_HAS_UBSAN_ARRAY_BOUNDS
>  config UBSAN_BOUNDS
>  	bool "Perform array index bounds checking"
>  	default UBSAN
> -	depends on !UBSAN_KCOV_BROKEN
>  	depends on CC_HAS_UBSAN_ARRAY_BOUNDS || CC_HAS_UBSAN_BOUNDS
>  	help
>  	  This option enables detection of directly indexed out of bounds
> @@ -72,7 +61,6 @@ config UBSAN_ARRAY_BOUNDS
>  config UBSAN_LOCAL_BOUNDS
>  	bool "Perform array local bounds checking"
>  	depends on UBSAN_TRAP
> -	depends on !UBSAN_KCOV_BROKEN
>  	depends on $(cc-option,-fsanitize=local-bounds)
>  	help
>  	  This option enables -fsanitize=local-bounds which traps when an
> -- 
> 2.34.0.384.gca35af8252-goog
> 

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

end of thread, other threads:[~2021-12-03 15:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 16:57 [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Nathan Chancellor
2021-11-29 16:57 ` [PATCH RFC 1/6] Documentation: Raise the " Nathan Chancellor
2021-11-29 16:57 ` [PATCH RFC 2/6] mm, slab: Remove compiler check in __kmalloc_index Nathan Chancellor
2021-11-29 16:58 ` [PATCH RFC 3/6] arch/Kconfig: Remove CLANG_VERSION check in HAS_LTO_CLANG Nathan Chancellor
2021-11-29 16:58 ` [PATCH RFC 4/6] Revert "ARM: 9070/1: Make UNWINDER_ARM depend on ld.bfd or ld.lld 11.0.0+" Nathan Chancellor
2021-11-29 16:58 ` [PATCH RFC 5/6] gcov: Remove compiler version check Nathan Chancellor
2021-11-29 16:58 ` [PATCH RFC 6/6] init/Kconfig: Drop linker version check for LD_ORPHAN_WARN Nathan Chancellor
2021-11-29 17:27 ` [PATCH RFC 0/6] Bump minimum supported version of LLVM to 11.0.0 Miguel Ojeda
2021-11-29 17:56 ` Mark Brown
2021-11-29 18:30 ` Nick Desaulniers
2021-12-01 19:41 ` Kees Cook
2021-12-02  8:26   ` Masahiro Yamada
2021-12-03 13:38     ` Marco Elver
2021-12-03 15:51       ` Nathan Chancellor

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).