From: Greg Kroah-Hartman Date: Fri, 11 Aug 2023 14:28:11 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v4.14.323~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=722117b24528d18ab682dcf94b8221a96221d5f4;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: gcc-plugins-reorganize-gimple-includes-for-gcc-13.patch revert-loongarch-cpu-switch-to-arch_cpu_finalize_init.patch series --- diff --git a/queue-6.1/gcc-plugins-reorganize-gimple-includes-for-gcc-13.patch b/queue-6.1/gcc-plugins-reorganize-gimple-includes-for-gcc-13.patch new file mode 100644 index 00000000000..7eae517523d --- /dev/null +++ b/queue-6.1/gcc-plugins-reorganize-gimple-includes-for-gcc-13.patch @@ -0,0 +1,47 @@ +From e6a71160cc145e18ab45195abf89884112e02dfb Mon Sep 17 00:00:00 2001 +From: Kees Cook +Date: Wed, 18 Jan 2023 12:21:35 -0800 +Subject: gcc-plugins: Reorganize gimple includes for GCC 13 + +From: Kees Cook + +commit e6a71160cc145e18ab45195abf89884112e02dfb upstream. + +The gimple-iterator.h header must be included before gimple-fold.h +starting with GCC 13. Reorganize gimple headers to work for all GCC +versions. + +Reported-by: Palmer Dabbelt +Acked-by: Palmer Dabbelt +Link: https://lore.kernel.org/all/20230113173033.4380-1-palmer@rivosinc.com/ +Cc: linux-hardening@vger.kernel.org +Signed-off-by: Kees Cook +Cc: Naresh Kamboju +Signed-off-by: Greg Kroah-Hartman +--- + scripts/gcc-plugins/gcc-common.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/scripts/gcc-plugins/gcc-common.h ++++ b/scripts/gcc-plugins/gcc-common.h +@@ -71,7 +71,9 @@ + #include "varasm.h" + #include "stor-layout.h" + #include "internal-fn.h" ++#include "gimple.h" + #include "gimple-expr.h" ++#include "gimple-iterator.h" + #include "gimple-fold.h" + #include "context.h" + #include "tree-ssa-alias.h" +@@ -85,10 +87,8 @@ + #include "tree-eh.h" + #include "stmt.h" + #include "gimplify.h" +-#include "gimple.h" + #include "tree-phinodes.h" + #include "tree-cfg.h" +-#include "gimple-iterator.h" + #include "gimple-ssa.h" + #include "ssa-iterators.h" + diff --git a/queue-6.1/revert-loongarch-cpu-switch-to-arch_cpu_finalize_init.patch b/queue-6.1/revert-loongarch-cpu-switch-to-arch_cpu_finalize_init.patch new file mode 100644 index 00000000000..08654875f42 --- /dev/null +++ b/queue-6.1/revert-loongarch-cpu-switch-to-arch_cpu_finalize_init.patch @@ -0,0 +1,67 @@ +From 5744384a5ce9cd5cdc62db7427c1d26ba8543da1 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Fri, 11 Aug 2023 16:26:20 +0200 +Subject: Revert "loongarch/cpu: Switch to arch_cpu_finalize_init()" + +From: Greg Kroah-Hartman + +This reverts commit 08e86d42e2c916e362d124e3bc6c824eb1862498 which is +commit 9841c423164787feb8f1442f922b7d80a70c82f1 upstream. + +As Gunter reports: + Building loongarch:defconfig ... failed + -------------- + Error log: + :569:2: warning: #warning syscall fstat not implemented [-Wcpp] + arch/loongarch/kernel/setup.c: In function 'arch_cpu_finalize_init': + arch/loongarch/kernel/setup.c:86:9: error: implicit declaration of function 'alternative_instructions' + + Actually introduced in v6.1.44 with commit 08e86d42e2c9 ("loongarch/cpu: + Switch to arch_cpu_finalize_init()"). Alternative instruction support + was only introduced for loongarch in v6.2 with commit 19e5eb15b00c + ("LoongArch: Add alternative runtime patching mechanism"). + +So revert it from 6.1.y. + +Reported-by: Guenter Roeck +Link: https://lore.kernel.org/r/fcd7b764-9047-22ba-a040-41b6ff99959c@roeck-us.net +Cc: Thomas Gleixner +Cc: Daniel Sneddon +Signed-off-by: Greg Kroah-Hartman +--- + arch/loongarch/Kconfig | 1 - + arch/loongarch/kernel/setup.c | 6 ------ + 2 files changed, 7 deletions(-) + +--- a/arch/loongarch/Kconfig ++++ b/arch/loongarch/Kconfig +@@ -10,7 +10,6 @@ config LOONGARCH + select ARCH_ENABLE_MEMORY_HOTPLUG + select ARCH_ENABLE_MEMORY_HOTREMOVE + select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI +- select ARCH_HAS_CPU_FINALIZE_INIT + select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE + select ARCH_HAS_PTE_SPECIAL + select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST +--- a/arch/loongarch/kernel/setup.c ++++ b/arch/loongarch/kernel/setup.c +@@ -12,7 +12,6 @@ + */ + #include + #include +-#include + #include + #include + #include +@@ -81,11 +80,6 @@ const char *get_system_type(void) + return "generic-loongson-machine"; + } + +-void __init arch_cpu_finalize_init(void) +-{ +- alternative_instructions(); +-} +- + static const char *dmi_string_parse(const struct dmi_header *dm, u8 s) + { + const u8 *bp = ((u8 *) dm) + dm->length; diff --git a/queue-6.1/series b/queue-6.1/series new file mode 100644 index 00000000000..4dfbb6359af --- /dev/null +++ b/queue-6.1/series @@ -0,0 +1,2 @@ +gcc-plugins-reorganize-gimple-includes-for-gcc-13.patch +revert-loongarch-cpu-switch-to-arch_cpu_finalize_init.patch