From: Greg Kroah-Hartman Date: Tue, 17 Jun 2025 14:12:11 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v6.6.94~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7def500d5da5b4fe0f804ff698808028adecc3a;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: drm-amd-display-do-not-add-mhard-float-to-dcn2-1-0-_resource.o-for-clang.patch drm-amd-display-do-not-add-mhard-float-to-dml_ccflags-for-clang.patch kbuild-add-clang_flags-to-as-instr.patch kbuild-add-clang_flags-to-kbuild_cppflags.patch kbuild-add-kbuild_cppflags-to-as-option-invocation.patch kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch mips-include-kbuild_cppflags-in-checkflags-invocation.patch mips-move-wa-msoft-float-check-from-as-option-to-cc-option.patch mips-prefer-cc-option-for-additions-to-cflags.patch posix-cpu-timers-fix-race-between-handle_posix_cpu_timers-and-posix_cpu_timer_del.patch x86-boot-compressed-prefer-cc-option-for-cflags-additions.patch --- diff --git a/queue-5.15/drm-amd-display-do-not-add-mhard-float-to-dcn2-1-0-_resource.o-for-clang.patch b/queue-5.15/drm-amd-display-do-not-add-mhard-float-to-dcn2-1-0-_resource.o-for-clang.patch new file mode 100644 index 0000000000..ab53a040b5 --- /dev/null +++ b/queue-5.15/drm-amd-display-do-not-add-mhard-float-to-dcn2-1-0-_resource.o-for-clang.patch @@ -0,0 +1,55 @@ +From 95a29c05be26757e20051920b9ecc2d72c73c1f3 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 4 Jun 2025 14:08:09 -0700 +Subject: drm/amd/display: Do not add '-mhard-float' to dcn2{1,0}_resource.o for clang + +From: Nathan Chancellor + +This patch is for linux-5.15.y and earlier only. It is functionally +equivalent to upstream commit 7db038d9790e ("drm/amd/display: Do not add +'-mhard-float' to dml_ccflags for clang"), which was created after all +files that require '-mhard-float' were moved under the dml folder. In +kernels older than 5.18, which do not contain upstream commits + + 22f87d998326 ("drm/amd/display: move FPU operations from dcn21 to dml/dcn20 folder") + cf689e869cf0 ("drm/amd/display: move FPU-related code from dcn20 to dml folder") + +newer versions of clang error with + + clang: error: unsupported option '-mhard-float' for target 'x86_64-linux-gnu' + make[6]: *** [scripts/Makefile.build:289: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_resource.o] Error 1 + clang: error: unsupported option '-mhard-float' for target 'x86_64-linux-gnu' + make[6]: *** [scripts/Makefile.build:289: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.o] Error 1 + +Apply a functionally equivalent change to prevent adding '-mhard-float' +with clang for these files. + +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 2 +- + drivers/gpu/drm/amd/display/dc/dcn21/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/amd/display/dc/dcn20/Makefile ++++ b/drivers/gpu/drm/amd/display/dc/dcn20/Makefile +@@ -10,7 +10,7 @@ DCN20 = dcn20_resource.o dcn20_init.o dc + DCN20 += dcn20_dsc.o + + ifdef CONFIG_X86 +-CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mhard-float -msse ++CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := $(if $(CONFIG_CC_IS_GCC), -mhard-float) -msse + endif + + ifdef CONFIG_PPC64 +--- a/drivers/gpu/drm/amd/display/dc/dcn21/Makefile ++++ b/drivers/gpu/drm/amd/display/dc/dcn21/Makefile +@@ -6,7 +6,7 @@ DCN21 = dcn21_init.o dcn21_hubp.o dcn21_ + dcn21_hwseq.o dcn21_link_encoder.o dcn21_dccg.o + + ifdef CONFIG_X86 +-CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mhard-float -msse ++CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := $(if $(CONFIG_CC_IS_GCC), -mhard-float) -msse + endif + + ifdef CONFIG_PPC64 diff --git a/queue-5.15/drm-amd-display-do-not-add-mhard-float-to-dml_ccflags-for-clang.patch b/queue-5.15/drm-amd-display-do-not-add-mhard-float-to-dml_ccflags-for-clang.patch new file mode 100644 index 0000000000..02815ec08b --- /dev/null +++ b/queue-5.15/drm-amd-display-do-not-add-mhard-float-to-dml_ccflags-for-clang.patch @@ -0,0 +1,43 @@ +From f53b2c11a303ee300c7ef802da56c41f928f7ab8 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 11 Jan 2023 20:05:09 -0700 +Subject: drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang + +From: Nathan Chancellor + +commit 7db038d9790eda558dd6c1dde4cdd58b64789c47 upstream. + +When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it +warns: + + clang-16: error: argument unused during compilation: '-mhard-float' [-Werror,-Wunused-command-line-argument] + +Similar to commit 84edc2eff827 ("selftest/fpu: avoid clang warning"), +just add this flag to GCC builds. Commit 0f0727d971f6 ("drm/amd/display: +readd -msse2 to prevent Clang from emitting libcalls to undefined SW FP +routines") added '-msse2' to prevent clang from emitting software +floating point routines. + +Signed-off-by: Nathan Chancellor +Acked-by: Alex Deucher +Tested-by: Linux Kernel Functional Testing +Tested-by: Anders Roxell +Signed-off-by: Masahiro Yamada +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/dml/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile ++++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile +@@ -26,7 +26,8 @@ + # subcomponents. + + ifdef CONFIG_X86 +-dml_ccflags := -mhard-float -msse ++dml_ccflags-$(CONFIG_CC_IS_GCC) := -mhard-float ++dml_ccflags := $(dml_ccflags-y) -msse + endif + + ifdef CONFIG_PPC64 diff --git a/queue-5.15/kbuild-add-clang_flags-to-as-instr.patch b/queue-5.15/kbuild-add-clang_flags-to-as-instr.patch new file mode 100644 index 0000000000..8a2bdfbe20 --- /dev/null +++ b/queue-5.15/kbuild-add-clang_flags-to-as-instr.patch @@ -0,0 +1,43 @@ +From 46dfd9d2352d780a4931ee5bfb11de700f8a0ad0 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Thu, 1 Jun 2023 12:50:39 -0700 +Subject: kbuild: Add CLANG_FLAGS to as-instr + +From: Nathan Chancellor + +commit cff6e7f50bd315e5b39c4e46c704ac587ceb965f upstream. + +A future change will move CLANG_FLAGS from KBUILD_{A,C}FLAGS to +KBUILD_CPPFLAGS so that '--target' is available while preprocessing. +When that occurs, the following errors appear multiple times when +building ARCH=powerpc powernv_defconfig: + + ld.lld: error: vmlinux.a(arch/powerpc/kernel/head_64.o):(.text+0x12d4): relocation R_PPC64_ADDR16_HI out of range: -4611686018409717520 is not in [-2147483648, 2147483647]; references '__start___soft_mask_table' + ld.lld: error: vmlinux.a(arch/powerpc/kernel/head_64.o):(.text+0x12e8): relocation R_PPC64_ADDR16_HI out of range: -4611686018409717392 is not in [-2147483648, 2147483647]; references '__stop___soft_mask_table' + +Diffing the .o.cmd files reveals that -DHAVE_AS_ATHIGH=1 is not present +anymore, because as-instr only uses KBUILD_AFLAGS, which will no longer +contain '--target'. + +Mirror Kconfig's as-instr and add CLANG_FLAGS explicitly to the +invocation to ensure the target information is always present. + +Signed-off-by: Nathan Chancellor +Signed-off-by: Masahiro Yamada +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + scripts/Makefile.compiler | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/Makefile.compiler ++++ b/scripts/Makefile.compiler +@@ -38,7 +38,7 @@ as-option = $(call try-run,\ + # Usage: aflags-y += $(call as-instr,instr,option1,option2) + + as-instr = $(call try-run,\ +- printf "%b\n" "$(1)" | $(CC) -Werror $(KBUILD_AFLAGS) -c -x assembler-with-cpp -o "$$TMP" -,$(2),$(3)) ++ printf "%b\n" "$(1)" | $(CC) -Werror $(CLANG_FLAGS) $(KBUILD_AFLAGS) -c -x assembler-with-cpp -o "$$TMP" -,$(2),$(3)) + + # __cc-option + # Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) diff --git a/queue-5.15/kbuild-add-clang_flags-to-kbuild_cppflags.patch b/queue-5.15/kbuild-add-clang_flags-to-kbuild_cppflags.patch new file mode 100644 index 0000000000..6574303d62 --- /dev/null +++ b/queue-5.15/kbuild-add-clang_flags-to-kbuild_cppflags.patch @@ -0,0 +1,51 @@ +From f48a7cc6d5347888037fc41bd55014b0f578a9d9 Mon Sep 17 00:00:00 2001 +From: Masahiro Yamada +Date: Sun, 9 Apr 2023 23:53:57 +0900 +Subject: kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS + +From: Masahiro Yamada + +commit feb843a469fb0ab00d2d23cfb9bcc379791011bb upstream. + +When preprocessing arch/*/kernel/vmlinux.lds.S, the target triple is +not passed to $(CPP) because we add it only to KBUILD_{C,A}FLAGS. + +As a result, the linker script is preprocessed with predefined macros +for the build host instead of the target. + +Assuming you use an x86 build machine, compare the following: + + $ clang -dM -E -x c /dev/null + $ clang -dM -E -x c /dev/null -target aarch64-linux-gnu + +There is no actual problem presumably because our linker scripts do not +rely on such predefined macros, but it is better to define correct ones. + +Move $(CLANG_FLAGS) to KBUILD_CPPFLAGS, so that all *.c, *.S, *.lds.S +will be processed with the proper target triple. + +[Note] +After the patch submission, we got an actual problem that needs this +commit. (CBL issue 1859) + +Link: https://github.com/ClangBuiltLinux/linux/issues/1859 +Reported-by: Tom Rini +Signed-off-by: Masahiro Yamada +Reviewed-by: Nathan Chancellor +Tested-by: Nathan Chancellor +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + scripts/Makefile.clang | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/scripts/Makefile.clang ++++ b/scripts/Makefile.clang +@@ -35,6 +35,5 @@ endif + # so they can be implemented or wrapped in cc-option. + CLANG_FLAGS += -Werror=unknown-warning-option + CLANG_FLAGS += -Werror=ignored-optimization-argument +-KBUILD_CFLAGS += $(CLANG_FLAGS) +-KBUILD_AFLAGS += $(CLANG_FLAGS) ++KBUILD_CPPFLAGS += $(CLANG_FLAGS) + export CLANG_FLAGS diff --git a/queue-5.15/kbuild-add-kbuild_cppflags-to-as-option-invocation.patch b/queue-5.15/kbuild-add-kbuild_cppflags-to-as-option-invocation.patch new file mode 100644 index 0000000000..19abafabce --- /dev/null +++ b/queue-5.15/kbuild-add-kbuild_cppflags-to-as-option-invocation.patch @@ -0,0 +1,58 @@ +From 6889c84760677af5cb34e1432ea09fd18975f8e3 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 6 Jun 2023 15:40:35 -0700 +Subject: kbuild: Add KBUILD_CPPFLAGS to as-option invocation + +From: Nathan Chancellor + +commit 43fc0a99906e04792786edf8534d8d58d1e9de0c upstream. + +After commit feb843a469fb ("kbuild: add $(CLANG_FLAGS) to +KBUILD_CPPFLAGS"), there is an error while building certain PowerPC +assembly files with clang: + + arch/powerpc/lib/copypage_power7.S: Assembler messages: + arch/powerpc/lib/copypage_power7.S:34: Error: junk at end of line: `0b01000' + arch/powerpc/lib/copypage_power7.S:35: Error: junk at end of line: `0b01010' + arch/powerpc/lib/copypage_power7.S:37: Error: junk at end of line: `0b01000' + arch/powerpc/lib/copypage_power7.S:38: Error: junk at end of line: `0b01010' + arch/powerpc/lib/copypage_power7.S:40: Error: junk at end of line: `0b01010' + clang: error: assembler command failed with exit code 1 (use -v to see invocation) + +as-option only uses KBUILD_AFLAGS, so after removing CLANG_FLAGS from +KBUILD_AFLAGS, there is no more '--target=' or '--prefix=' flags. As a +result of those missing flags, the host target +will be tested during as-option calls and likely fail, meaning necessary +flags may not get added when building assembly files, resulting in +errors like seen above. + +Add KBUILD_CPPFLAGS to as-option invocations to clear up the errors. +This should have been done in commit d5c8d6e0fa61 ("kbuild: Update +assembler calls to use proper flags and language target"), which +switched from using the assembler target to the assembler-with-cpp +target, so flags that affect preprocessing are passed along in all +relevant tests. as-option now mirrors cc-option. + +Fixes: feb843a469fb ("kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS") +Reported-by: Linux Kernel Functional Testing +Closes: https://lore.kernel.org/CA+G9fYs=koW9WardsTtora+nMgLR3raHz-LSLr58tgX4T5Mxag@mail.gmail.com/ +Signed-off-by: Nathan Chancellor +Tested-by: Naresh Kamboju +Signed-off-by: Masahiro Yamada +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + scripts/Makefile.compiler | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/Makefile.compiler ++++ b/scripts/Makefile.compiler +@@ -32,7 +32,7 @@ try-run = $(shell set -e; \ + # Usage: aflags-y += $(call as-option,-Wa$(comma)-isa=foo,) + + as-option = $(call try-run,\ +- $(CC) -Werror $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /dev/null -o "$$TMP",$(1),$(2)) ++ $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /dev/null -o "$$TMP",$(1),$(2)) + + # as-instr + # Usage: aflags-y += $(call as-instr,instr,option1,option2) diff --git a/queue-5.15/kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch b/queue-5.15/kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch new file mode 100644 index 0000000000..2b3eca7f96 --- /dev/null +++ b/queue-5.15/kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch @@ -0,0 +1,91 @@ +From 01d9e28227e3b0e79082e7acae18496c58d83528 Mon Sep 17 00:00:00 2001 +From: Nick Desaulniers +Date: Wed, 11 Jan 2023 20:05:01 -0700 +Subject: kbuild: Update assembler calls to use proper flags and language target + +From: Nick Desaulniers + +commit d5c8d6e0fa61401a729e9eb6a9c7077b2d3aebb0 upstream. + +as-instr uses KBUILD_AFLAGS, but as-option uses KBUILD_CFLAGS. This can +cause as-option to fail unexpectedly when CONFIG_WERROR is set, because +clang will emit -Werror,-Wunused-command-line-argument for various -m +and -f flags in KBUILD_CFLAGS for assembler sources. + +Callers of as-option and as-instr should be adding flags to +KBUILD_AFLAGS / aflags-y, not KBUILD_CFLAGS / cflags-y. Use +KBUILD_AFLAGS in all macros to clear up the initial problem. + +Unfortunately, -Wunused-command-line-argument can still be triggered +with clang by the presence of warning flags or macro definitions because +'-x assembler' is used, instead of '-x assembler-with-cpp', which will +consume these flags. Switch to '-x assembler-with-cpp' in places where +'-x assembler' is used, as the compiler is always used as the driver for +out of line assembler sources in the kernel. + +Finally, add -Werror to these macros so that they behave consistently +whether or not CONFIG_WERROR is set. + +[nathan: Reworded and expanded on problems in commit message + Use '-x assembler-with-cpp' in a couple more places] + +Link: https://github.com/ClangBuiltLinux/linux/issues/1699 +Suggested-by: Masahiro Yamada +Signed-off-by: Nick Desaulniers +Signed-off-by: Nathan Chancellor +Tested-by: Linux Kernel Functional Testing +Tested-by: Anders Roxell +Signed-off-by: Masahiro Yamada +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + scripts/Kconfig.include | 2 +- + scripts/Makefile.compiler | 8 ++++---- + scripts/as-version.sh | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +--- a/scripts/Kconfig.include ++++ b/scripts/Kconfig.include +@@ -33,7 +33,7 @@ ld-option = $(success,$(LD) -v $(1)) + + # $(as-instr,) + # Return y if the assembler supports , n otherwise +-as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler -o /dev/null -) ++as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler-with-cpp -o /dev/null -) + + # check if $(CC) and $(LD) exist + $(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found) +--- a/scripts/Makefile.compiler ++++ b/scripts/Makefile.compiler +@@ -29,16 +29,16 @@ try-run = $(shell set -e; \ + fi) + + # as-option +-# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) ++# Usage: aflags-y += $(call as-option,-Wa$(comma)-isa=foo,) + + as-option = $(call try-run,\ +- $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2)) ++ $(CC) -Werror $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /dev/null -o "$$TMP",$(1),$(2)) + + # as-instr +-# Usage: cflags-y += $(call as-instr,instr,option1,option2) ++# Usage: aflags-y += $(call as-instr,instr,option1,option2) + + as-instr = $(call try-run,\ +- printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) ++ printf "%b\n" "$(1)" | $(CC) -Werror $(KBUILD_AFLAGS) -c -x assembler-with-cpp -o "$$TMP" -,$(2),$(3)) + + # __cc-option + # Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) +--- a/scripts/as-version.sh ++++ b/scripts/as-version.sh +@@ -45,7 +45,7 @@ orig_args="$@" + # Get the first line of the --version output. + IFS=' + ' +-set -- $(LC_ALL=C "$@" -Wa,--version -c -x assembler /dev/null -o /dev/null 2>/dev/null) ++set -- $(LC_ALL=C "$@" -Wa,--version -c -x assembler-with-cpp /dev/null -o /dev/null 2>/dev/null) + + # Split the line on spaces. + IFS=' ' diff --git a/queue-5.15/mips-include-kbuild_cppflags-in-checkflags-invocation.patch b/queue-5.15/mips-include-kbuild_cppflags-in-checkflags-invocation.patch new file mode 100644 index 0000000000..5cf003dfd1 --- /dev/null +++ b/queue-5.15/mips-include-kbuild_cppflags-in-checkflags-invocation.patch @@ -0,0 +1,38 @@ +From a4f869e88a21880939d0b956b20d6a70c5298de3 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Thu, 1 Jun 2023 11:38:24 -0700 +Subject: mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation + +From: Nathan Chancellor + +commit 08f6554ff90ef189e6b8f0303e57005bddfdd6a7 upstream. + +A future change will move CLANG_FLAGS from KBUILD_{A,C}FLAGS to +KBUILD_CPPFLAGS so that '--target' is available while preprocessing. +When that occurs, the following error appears when building ARCH=mips +with clang (tip of tree error shown): + + clang: error: unsupported option '-mabi=' for target 'x86_64-pc-linux-gnu' + +Add KBUILD_CPPFLAGS in the CHECKFLAGS invocation to keep everything +working after the move. + +Signed-off-by: Nathan Chancellor +Signed-off-by: Masahiro Yamada +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -322,7 +322,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwin + KBUILD_LDFLAGS += -m $(ld-emul) + + ifdef need-compiler +-CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ ++CHECKFLAGS += $(shell $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ + grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \ + sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g') + endif diff --git a/queue-5.15/mips-move-wa-msoft-float-check-from-as-option-to-cc-option.patch b/queue-5.15/mips-move-wa-msoft-float-check-from-as-option-to-cc-option.patch new file mode 100644 index 0000000000..d194a68a03 --- /dev/null +++ b/queue-5.15/mips-move-wa-msoft-float-check-from-as-option-to-cc-option.patch @@ -0,0 +1,42 @@ +From 4b4e7a4e8985db4d9e0dae0bf5a6b217fef46501 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 14 Jun 2023 11:04:36 -0700 +Subject: MIPS: Move '-Wa,-msoft-float' check from as-option to cc-option + +From: Nathan Chancellor + +This patch is for linux-6.1.y and earlier, it has no direct mainline +equivalent. + +In order to backport commit d5c8d6e0fa61 ("kbuild: Update assembler +calls to use proper flags and language target") to resolve a separate +issue regarding PowerPC, the problem noticed and fixed by +commit 80a20d2f8288 ("MIPS: Always use -Wa,-msoft-float and eliminate +GAS_HAS_SET_HARDFLOAT") needs to be addressed. Unfortunately, 6.1 and +earlier do not contain commit e4412739472b ("Documentation: raise +minimum supported version of binutils to 2.25"), so it cannot be assumed +that all supported versions of GNU as have support for -msoft-float. + +In order to switch from KBUILD_CFLAGS to KBUILD_AFLAGS in as-option +without consequence, move the '-Wa,-msoft-float' check to cc-option, +including '$(cflags-y)' directly to avoid the issue mentioned in +commit 80a20d2f8288 ("MIPS: Always use -Wa,-msoft-float and eliminate +GAS_HAS_SET_HARDFLOAT"). + +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -110,7 +110,7 @@ endif + # (specifically newer than 2.24.51.20140728) we then also need to explicitly + # set ".set hardfloat" in all files which manipulate floating point registers. + # +-ifneq ($(call as-option,-Wa$(comma)-msoft-float,),) ++ifneq ($(call cc-option,$(cflags-y) -Wa$(comma)-msoft-float,),) + cflags-y += -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float + endif + diff --git a/queue-5.15/mips-prefer-cc-option-for-additions-to-cflags.patch b/queue-5.15/mips-prefer-cc-option-for-additions-to-cflags.patch new file mode 100644 index 0000000000..0d7f5341a9 --- /dev/null +++ b/queue-5.15/mips-prefer-cc-option-for-additions-to-cflags.patch @@ -0,0 +1,51 @@ +From 68a4897d6e554da3a1daa7458f22ce118a5f62d6 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 11 Jan 2023 20:05:00 -0700 +Subject: MIPS: Prefer cc-option for additions to cflags + +From: Nathan Chancellor + +commit 337ff6bb8960fdc128cabd264aaea3d42ca27a32 upstream. + +A future change will switch as-option to use KBUILD_AFLAGS instead of +KBUILD_CFLAGS to allow clang to drop -Qunused-arguments, which may cause +issues if the flag being tested requires a flag previously added to +KBUILD_CFLAGS but not KBUILD_AFLAGS. Use cc-option for cflags additions +so that the flags are tested properly. + +Signed-off-by: Nathan Chancellor +Acked-by: Thomas Bogendoerfer +Reviewed-by: Nick Desaulniers +Reviewed-by: Philippe Mathieu-Daudé +Tested-by: Linux Kernel Functional Testing +Tested-by: Anders Roxell +Signed-off-by: Masahiro Yamada +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/Makefile | 2 +- + arch/mips/loongson2ef/Platform | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -153,7 +153,7 @@ cflags-y += -fno-stack-check + # + # Avoid this by explicitly disabling that assembler behaviour. + # +-cflags-y += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) ++cflags-y += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) + + # + # CPU-dependent compiler/assembler options for optimization. +--- a/arch/mips/loongson2ef/Platform ++++ b/arch/mips/loongson2ef/Platform +@@ -28,7 +28,7 @@ cflags-$(CONFIG_CPU_LOONGSON2F) += \ + # binutils does not merge support for the flag then we can revisit & remove + # this later - for now it ensures vendor toolchains don't cause problems. + # +-cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) ++cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) + + # Enable the workarounds for Loongson2f + ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS diff --git a/queue-5.15/posix-cpu-timers-fix-race-between-handle_posix_cpu_timers-and-posix_cpu_timer_del.patch b/queue-5.15/posix-cpu-timers-fix-race-between-handle_posix_cpu_timers-and-posix_cpu_timer_del.patch new file mode 100644 index 0000000000..8f016d4a6e --- /dev/null +++ b/queue-5.15/posix-cpu-timers-fix-race-between-handle_posix_cpu_timers-and-posix_cpu_timer_del.patch @@ -0,0 +1,55 @@ +From f90fff1e152dedf52b932240ebbd670d83330eca Mon Sep 17 00:00:00 2001 +From: Oleg Nesterov +Date: Fri, 13 Jun 2025 19:26:50 +0200 +Subject: posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Oleg Nesterov + +commit f90fff1e152dedf52b932240ebbd670d83330eca upstream. + +If an exiting non-autoreaping task has already passed exit_notify() and +calls handle_posix_cpu_timers() from IRQ, it can be reaped by its parent +or debugger right after unlock_task_sighand(). + +If a concurrent posix_cpu_timer_del() runs at that moment, it won't be +able to detect timer->it.cpu.firing != 0: cpu_timer_task_rcu() and/or +lock_task_sighand() will fail. + +Add the tsk->exit_state check into run_posix_cpu_timers() to fix this. + +This fix is not needed if CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y, because +exit_task_work() is called before exit_notify(). But the check still +makes sense, task_work_add(&tsk->posix_cputimers_work.work) will fail +anyway in this case. + +Cc: stable@vger.kernel.org +Reported-by: Benoît Sevens +Fixes: 0bdd2ed4138e ("sched: run_posix_cpu_timers: Don't check ->exit_state, use lock_task_sighand()") +Signed-off-by: Oleg Nesterov +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + kernel/time/posix-cpu-timers.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/kernel/time/posix-cpu-timers.c ++++ b/kernel/time/posix-cpu-timers.c +@@ -1432,6 +1432,15 @@ void run_posix_cpu_timers(void) + lockdep_assert_irqs_disabled(); + + /* ++ * Ensure that release_task(tsk) can't happen while ++ * handle_posix_cpu_timers() is running. Otherwise, a concurrent ++ * posix_cpu_timer_del() may fail to lock_task_sighand(tsk) and ++ * miss timer->it.cpu.firing != 0. ++ */ ++ if (tsk->exit_state) ++ return; ++ ++ /* + * If the actual expiry is deferred to task work context and the + * work is already scheduled there is no point to do anything here. + */ diff --git a/queue-5.15/series b/queue-5.15/series index f17f63519b..1ed5e0aab8 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -165,3 +165,14 @@ fs-filesystems-fix-potential-unsigned-integer-underf.patch nvmet-fcloop-access-fcpreq-only-when-holding-reqlock.patch perf-ensure-bpf_perf_link-path-is-properly-serialize.patch alsa-usb-audio-add-implicit-feedback-quirk-for-rode-ai-1.patch +posix-cpu-timers-fix-race-between-handle_posix_cpu_timers-and-posix_cpu_timer_del.patch +x86-boot-compressed-prefer-cc-option-for-cflags-additions.patch +mips-move-wa-msoft-float-check-from-as-option-to-cc-option.patch +mips-prefer-cc-option-for-additions-to-cflags.patch +kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch +drm-amd-display-do-not-add-mhard-float-to-dml_ccflags-for-clang.patch +mips-include-kbuild_cppflags-in-checkflags-invocation.patch +kbuild-add-clang_flags-to-as-instr.patch +kbuild-add-clang_flags-to-kbuild_cppflags.patch +kbuild-add-kbuild_cppflags-to-as-option-invocation.patch +drm-amd-display-do-not-add-mhard-float-to-dcn2-1-0-_resource.o-for-clang.patch diff --git a/queue-5.15/x86-boot-compressed-prefer-cc-option-for-cflags-additions.patch b/queue-5.15/x86-boot-compressed-prefer-cc-option-for-cflags-additions.patch new file mode 100644 index 0000000000..0de491bd7e --- /dev/null +++ b/queue-5.15/x86-boot-compressed-prefer-cc-option-for-cflags-additions.patch @@ -0,0 +1,43 @@ +From 06e31e53fddaab7e88f38e8f99a86e46ed8ca3f5 Mon Sep 17 00:00:00 2001 +From: Nick Desaulniers +Date: Wed, 11 Jan 2023 20:04:58 -0700 +Subject: x86/boot/compressed: prefer cc-option for CFLAGS additions + +From: Nick Desaulniers + +commit 994f5f7816ff963f49269cfc97f63cb2e4edb84f upstream. + +as-option tests new options using KBUILD_CFLAGS, which causes problems +when using as-option to update KBUILD_AFLAGS because many compiler +options are not valid assembler options. + +This will be fixed in a follow up patch. Before doing so, move the +assembler test for -Wa,-mrelax-relocations=no from using as-option to +cc-option. + +Link: https://lore.kernel.org/llvm/CAK7LNATcHt7GcXZ=jMszyH=+M_LC9Qr6yeAGRCBbE6xriLxtUQ@mail.gmail.com/ +Suggested-by: Masahiro Yamada +Reviewed-by: Nathan Chancellor +Tested-by: Nathan Chancellor +Signed-off-by: Nick Desaulniers +Signed-off-by: Nathan Chancellor +Tested-by: Linux Kernel Functional Testing +Tested-by: Anders Roxell +Signed-off-by: Masahiro Yamada +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/boot/compressed/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/boot/compressed/Makefile ++++ b/arch/x86/boot/compressed/Makefile +@@ -50,7 +50,7 @@ KBUILD_CFLAGS += $(call cc-option,-fmacr + KBUILD_CFLAGS += -fno-asynchronous-unwind-tables + KBUILD_CFLAGS += -D__DISABLE_EXPORTS + # Disable relocation relaxation in case the link is not PIE. +-KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no) ++KBUILD_CFLAGS += $(call cc-option,-Wa$(comma)-mrelax-relocations=no) + KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h + + # sev.c indirectly inludes inat-table.h which is generated during