linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] raise minimum GCC version to 5.1
@ 2021-09-10 23:40 Nick Desaulniers
  2021-09-10 23:40 ` [PATCH 01/10] Documentation: raise minimum supported version of GCC " Nick Desaulniers
                   ` (12 more replies)
  0 siblings, 13 replies; 45+ messages in thread
From: Nick Desaulniers @ 2021-09-10 23:40 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Rasmus Villemoes, Nathan Chancellor,
	Masahiro Yamada, Joe Perches, Arnd Bergmann, Stephen Rothwell,
	llvm, linux-kernel, Nick Desaulniers

commit fad7cd3310db ("nbd: add the check to prevent overflow in
__nbd_ioctl()")

raised an issue from the fallback helpers added in

commit f0907827a8a9 ("compiler.h: enable builtin overflow checkers and add fallback code")

Specifically, the helpers for checking whether the results of a
multiplication overflowed (__unsigned_mul_overflow,
__signed_add_overflow) use the division operator when
!COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW. This is problematic for 64b
operands on 32b hosts.

Also, because the macro is type agnostic, it is very difficult to write
a similarly type generic macro that dispatches to one of:
* div64_s64
* div64_u64
* div_s64
* div_u64

Raising the minimum supported versions allows us to remove all of the
fallback helpers for !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW, instead
dispatching the compiler builtins.

arm64 has already raised the minimum supported GCC version to 5.1, do
this for all targets now. See the link below for the previous
discussion.

Additional patches cleaning up a few obsolete version checks.

Link: https://lore.kernel.org/all/20210909182525.372ee687@canb.auug.org.au/
Link: https://lore.kernel.org/lkml/CAK7LNASs6dvU6D3jL2GG3jW58fXfaj6VNOe55NJnTB8UPuk2pA@mail.gmail.com/
Link: https://github.com/ClangBuiltLinux/linux/issues/1438

Nick Desaulniers (10):
  Documentation: raise minimum supported version of GCC to 5.1
  compiler.h: drop fallback overflow checkers
  mm/ksm: remove old GCC 4.9+ check
  Kconfig.debug: drop GCC 5+ version check for DWARF5
  riscv: remove Kconfig check for GCC version for ARCH_RV64I
  powerpc: remove GCC version check for UPD_CONSTR
  arm64: remove GCC version check for ARCH_SUPPORTS_INT128
  Makefile: drop GCC < 5 -fno-var-tracking-assignments workaround
  compiler-gcc.h: drop checks for older GCC versions
  vmlinux.lds.h: remove old check for GCC 4.9

 Documentation/process/changes.rst    |   2 +-
 Makefile                             |   6 --
 arch/arm64/Kconfig                   |   2 +-
 arch/powerpc/include/asm/asm-const.h |  10 --
 arch/riscv/Kconfig                   |   2 +-
 include/asm-generic/vmlinux.lds.h    |   4 -
 include/linux/compiler-clang.h       |  13 ---
 include/linux/compiler-gcc.h         |   8 +-
 include/linux/overflow.h             | 138 +-------------------------
 lib/Kconfig.debug                    |   2 +-
 mm/ksm.c                             |   2 -
 scripts/min-tool-version.sh          |   8 +-
 tools/include/linux/compiler-gcc.h   |   8 +-
 tools/include/linux/overflow.h       | 140 +--------------------------
 14 files changed, 13 insertions(+), 332 deletions(-)


base-commit: 2d338201d5311bcd79d42f66df4cecbcbc5f4f2c
-- 
2.33.0.309.g3052b89438-goog


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

end of thread, other threads:[~2021-10-05  0:57 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 23:40 [PATCH 00/10] raise minimum GCC version to 5.1 Nick Desaulniers
2021-09-10 23:40 ` [PATCH 01/10] Documentation: raise minimum supported version of GCC " Nick Desaulniers
2021-09-10 23:55   ` Nathan Chancellor
2021-09-11  0:16     ` Nick Desaulniers
2021-09-13 16:22   ` Kees Cook
2021-09-10 23:40 ` [PATCH 02/10] compiler.h: drop fallback overflow checkers Nick Desaulniers
2021-09-11  0:04   ` Nathan Chancellor
2021-09-14 15:33     ` Nick Desaulniers
2021-09-14 16:04       ` Nathan Chancellor
2021-09-13 16:21   ` Kees Cook
2021-09-10 23:40 ` [PATCH 03/10] mm/ksm: remove old GCC 4.9+ check Nick Desaulniers
2021-09-11  0:07   ` Nathan Chancellor
2021-09-13 16:22   ` Kees Cook
2021-09-10 23:40 ` [PATCH 04/10] Kconfig.debug: drop GCC 5+ version check for DWARF5 Nick Desaulniers
2021-09-11  0:08   ` Nathan Chancellor
2021-09-13 16:23   ` Kees Cook
2021-09-10 23:40 ` [PATCH 05/10] riscv: remove Kconfig check for GCC version for ARCH_RV64I Nick Desaulniers
2021-09-11  0:09   ` Nathan Chancellor
2021-09-13 16:23   ` Kees Cook
2021-10-05  0:40     ` Palmer Dabbelt
2021-10-05  0:50       ` Kees Cook
2021-10-05  0:57         ` Palmer Dabbelt
2021-09-10 23:40 ` [PATCH 06/10] powerpc: remove GCC version check for UPD_CONSTR Nick Desaulniers
2021-09-10 23:48   ` Nathan Chancellor
2021-09-11 10:43     ` Michael Ellerman
2021-09-11 15:34   ` Christophe Leroy
2021-09-10 23:40 ` [PATCH 07/10] arm64: remove GCC version check for ARCH_SUPPORTS_INT128 Nick Desaulniers
2021-09-11  0:10   ` Nathan Chancellor
2021-09-13 16:25   ` Kees Cook
2021-09-16 13:23   ` Catalin Marinas
2021-09-10 23:40 ` [PATCH 08/10] Makefile: drop GCC < 5 -fno-var-tracking-assignments workaround Nick Desaulniers
2021-09-11  0:11   ` Nathan Chancellor
2021-09-13 16:25   ` Kees Cook
2021-09-10 23:40 ` [PATCH 09/10] compiler-gcc.h: drop checks for older GCC versions Nick Desaulniers
2021-09-11  0:12   ` Nathan Chancellor
2021-09-13 16:26   ` Kees Cook
2021-09-10 23:40 ` [PATCH 10/10] vmlinux.lds.h: remove old check for GCC 4.9 Nick Desaulniers
2021-09-10 23:50   ` Nathan Chancellor
2021-09-14 15:21     ` Nick Desaulniers
2021-09-13 16:28   ` Kees Cook
2021-09-11  2:19 ` [PATCH 00/10] raise minimum GCC version to 5.1 Kees Cook
2021-09-11 10:42   ` Michael Ellerman
2021-09-13  9:49 ` Pavel Machek
2021-09-13 16:20   ` Kees Cook
2021-09-13 11:27 ` Arnd Bergmann

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