From: Greg Kroah-Hartman Date: Mon, 17 Jun 2024 12:33:41 +0000 (+0200) Subject: 6.9-stable patches X-Git-Tag: v6.1.95~114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f132aa8c1170fd373eb54c0e5e135d556c747cfc;p=thirdparty%2Fkernel%2Fstable-queue.git 6.9-stable patches added patches: powerpc-85xx-fix-compile-error-without-config_crash_dump.patch powerpc-uaccess-fix-build-errors-seen-with-gcc-13-14.patch --- diff --git a/queue-6.9/powerpc-85xx-fix-compile-error-without-config_crash_dump.patch b/queue-6.9/powerpc-85xx-fix-compile-error-without-config_crash_dump.patch new file mode 100644 index 00000000000..b63d93a5a40 --- /dev/null +++ b/queue-6.9/powerpc-85xx-fix-compile-error-without-config_crash_dump.patch @@ -0,0 +1,52 @@ +From 7b090b6ff51b9a9f002139660672f662b95f0630 Mon Sep 17 00:00:00 2001 +From: Hari Bathini +Date: Fri, 10 May 2024 13:37:57 +0530 +Subject: powerpc/85xx: fix compile error without CONFIG_CRASH_DUMP + +From: Hari Bathini + +commit 7b090b6ff51b9a9f002139660672f662b95f0630 upstream. + +Since commit 5c4233cc0920 ("powerpc/kdump: Split KEXEC_CORE and +CRASH_DUMP dependency"), crashing_cpu is not available without +CONFIG_CRASH_DUMP. Fix compile error on 64-BIT 85xx owing to this +change. + +Fixes: 5c4233cc0920 ("powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency") +Cc: stable@vger.kernel.org # v6.9+ +Reported-by: Christian Zigotzky +Closes: https://lore.kernel.org/all/fa247ae4-5825-4dbe-a737-d93b7ab4d4b9@xenosoft.de/ +Suggested-by: Michael Ellerman +Signed-off-by: Hari Bathini +Signed-off-by: Michael Ellerman +Link: https://msgid.link/20240510080757.560159-1-hbathini@linux.ibm.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/platforms/85xx/smp.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/arch/powerpc/platforms/85xx/smp.c ++++ b/arch/powerpc/platforms/85xx/smp.c +@@ -398,6 +398,7 @@ static void mpc85xx_smp_kexec_cpu_down(i + hard_irq_disable(); + mpic_teardown_this_cpu(secondary); + ++#ifdef CONFIG_CRASH_DUMP + if (cpu == crashing_cpu && cpu_thread_in_core(cpu) != 0) { + /* + * We enter the crash kernel on whatever cpu crashed, +@@ -406,9 +407,11 @@ static void mpc85xx_smp_kexec_cpu_down(i + */ + disable_threadbit = 1; + disable_cpu = cpu_first_thread_sibling(cpu); +- } else if (sibling != crashing_cpu && +- cpu_thread_in_core(cpu) == 0 && +- cpu_thread_in_core(sibling) != 0) { ++ } else if (sibling == crashing_cpu) { ++ return; ++ } ++#endif ++ if (cpu_thread_in_core(cpu) == 0 && cpu_thread_in_core(sibling) != 0) { + disable_threadbit = 2; + disable_cpu = sibling; + } diff --git a/queue-6.9/powerpc-uaccess-fix-build-errors-seen-with-gcc-13-14.patch b/queue-6.9/powerpc-uaccess-fix-build-errors-seen-with-gcc-13-14.patch new file mode 100644 index 00000000000..517910e38af --- /dev/null +++ b/queue-6.9/powerpc-uaccess-fix-build-errors-seen-with-gcc-13-14.patch @@ -0,0 +1,89 @@ +From 2d43cc701b96f910f50915ac4c2a0cae5deb734c Mon Sep 17 00:00:00 2001 +From: Michael Ellerman +Date: Wed, 29 May 2024 22:30:28 +1000 +Subject: powerpc/uaccess: Fix build errors seen with GCC 13/14 + +From: Michael Ellerman + +commit 2d43cc701b96f910f50915ac4c2a0cae5deb734c upstream. + +Building ppc64le_defconfig with GCC 14 fails with assembler errors: + + CC fs/readdir.o + /tmp/ccdQn0mD.s: Assembler messages: + /tmp/ccdQn0mD.s:212: Error: operand out of domain (18 is not a multiple of 4) + /tmp/ccdQn0mD.s:226: Error: operand out of domain (18 is not a multiple of 4) + ... [6 lines] + /tmp/ccdQn0mD.s:1699: Error: operand out of domain (18 is not a multiple of 4) + +A snippet of the asm shows: + + # ../fs/readdir.c:210: unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end); + ld 9,0(29) # MEM[(u64 *)name_38(D) + _88 * 1], MEM[(u64 *)name_38(D) + _88 * 1] + # 210 "../fs/readdir.c" 1 + 1: std 9,18(8) # put_user # *__pus_addr_52, MEM[(u64 *)name_38(D) + _88 * 1] + +The 'std' instruction requires a 4-byte aligned displacement because +it is a DS-form instruction, and as the assembler says, 18 is not a +multiple of 4. + +A similar error is seen with GCC 13 and CONFIG_UBSAN_SIGNED_WRAP=y. + +The fix is to change the constraint on the memory operand to put_user(), +from "m" which is a general memory reference to "YZ". + +The "Z" constraint is documented in the GCC manual PowerPC machine +constraints, and specifies a "memory operand accessed with indexed or +indirect addressing". "Y" is not documented in the manual but specifies +a "memory operand for a DS-form instruction". Using both allows the +compiler to generate a DS-form "std" or X-form "stdx" as appropriate. + +The change has to be conditional on CONFIG_PPC_KERNEL_PREFIXED because +the "Y" constraint does not guarantee 4-byte alignment when prefixed +instructions are enabled. + +Unfortunately clang doesn't support the "Y" constraint so that has to be +behind an ifdef. + +Although the build error is only seen with GCC 13/14, that appears +to just be luck. The constraint has been incorrect since it was first +added. + +Fixes: c20beffeec3c ("powerpc/uaccess: Use flexible addressing with __put_user()/__get_user()") +Cc: stable@vger.kernel.org # v5.10+ +Suggested-by: Kewen Lin +Signed-off-by: Michael Ellerman +Link: https://msgid.link/20240529123029.146953-1-mpe@ellerman.id.au +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/include/asm/uaccess.h | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/arch/powerpc/include/asm/uaccess.h ++++ b/arch/powerpc/include/asm/uaccess.h +@@ -92,9 +92,25 @@ __pu_failed: \ + : label) + #endif + ++#ifdef CONFIG_CC_IS_CLANG ++#define DS_FORM_CONSTRAINT "Z<>" ++#else ++#define DS_FORM_CONSTRAINT "YZ<>" ++#endif ++ + #ifdef __powerpc64__ ++#ifdef CONFIG_PPC_KERNEL_PREFIXED + #define __put_user_asm2_goto(x, ptr, label) \ + __put_user_asm_goto(x, ptr, label, "std") ++#else ++#define __put_user_asm2_goto(x, addr, label) \ ++ asm goto ("1: std%U1%X1 %0,%1 # put_user\n" \ ++ EX_TABLE(1b, %l2) \ ++ : \ ++ : "r" (x), DS_FORM_CONSTRAINT (*addr) \ ++ : \ ++ : label) ++#endif // CONFIG_PPC_KERNEL_PREFIXED + #else /* __powerpc64__ */ + #define __put_user_asm2_goto(x, addr, label) \ + asm goto( \ diff --git a/queue-6.9/series b/queue-6.9/series index 11aa968c3ec..3c8e5eb9498 100644 --- a/queue-6.9/series +++ b/queue-6.9/series @@ -105,3 +105,5 @@ scsi-mpi3mr-fix-ata-ncq-priority-support.patch scsi-mpt3sas-avoid-test-set_bit-operating-in-non-allocated-memory.patch scsi-sd-use-read-16-when-reading-block-zero-on-large-capacity-disks.patch gve-clear-napi-skb-before-dev_kfree_skb_any.patch +powerpc-85xx-fix-compile-error-without-config_crash_dump.patch +powerpc-uaccess-fix-build-errors-seen-with-gcc-13-14.patch