summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2026-10-19 20:32:38 -0400
committerBorislav Petkov (AMD) <bp@alien8.de>2026-11-01 20:29:47 -0800
commitf01a394fe2a00d3cb4cf2cda279c58604a2540ad (patch)
tree7bf0df6a5117ddd0ef46b52847da6fbdcd1133e4 /scripts/Makefile.thinlto
parent3457b3bcd344005af894876cab4e634cabdcbb62 (diff)
downloadlinux-next-f01a394fe2a00d3cb4cf2cda279c58604a2540ad.tar.gz
linux-next-f01a394fe2a00d3cb4cf2cda279c58604a2540ad.zip
x86/csum: Relax the len and proto constraints in 32-bit csum_ipv6_magic()
Building an i386 allmodconfig kernel with clang fails since allmodconfig started building netfilter with GCOV profiling: In file included from net/netfilter/nf_synproxy_core.c:7: In file included from ./include/linux/skbuff.h:26: In file included from ./include/net/checksum.h:21: In file included from ./arch/x86/include/asm/checksum.h:9: ./arch/x86/include/asm/checksum_32.h:149:6: error: inline assembly requires more registers than available The csum_ipv6_magic() asm needs five registers at once: the early-clobber sum plus register-only inputs for saddr, daddr, htonl(len) and htonl(proto). With frame pointers enabled, six general purpose registers are left to choose from. In synproxy_send_tcp_ipv6(), the GCOV instrumentation lets clang's machine scheduler move the copies of two incoming register arguments, EDX and ECX, below the asm. Both registers then stay live across the asm, which leaves four registers for its five operands. This is LLVM issue #206307. The error goes away without either GCOV or frame pointers, and it reproduces with clang 19-22. Neither len nor proto has to be in a register: ADCL also takes a 32-bit memory or immediate source operand. Use "g" for both, so the asm needs at most three registers whatever the caller looks like. ASM_INPUT_G, which normally replaces "g" to avoid clang's poor handling of it, is not enough here. It expands to "ir" for clang, so callers that pass a variable protocol, like nf_ip6_checksum(), would still need five registers. With "g", clang passes a non-constant len or proto through the stack and still turns constants into immediates. [ bp: Make Rosen Penev the author because of a previous identical submission https://lore.kernel.org/all/20260904000833.2058186-1-rosenp@gmail.com/ and Sasha graciously agreeing and giving his much more detailed commit message explaining the background of why this exists. ] Fixes: 403cec8ab6d0 ("netfilter: add option for GCOV profiling") Closes: https://dashboard.kernelci.org/build/maestro:6ad55fe255fda507603d2651 Closes: https://lore.kernel.org/a28df759-d0e9-41c0-97c7-5f89a18d54e2@oss.qualcomm.com Reported-by: kernelci.org bot <bot@kernelci.org> Reported-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Assisted-by: LLM Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Nick Desaulniers <ndesaulniers@google.com> Cc: stable@vger.kernel.org Link: https://github.com/llvm/llvm-project/issues/206307
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions