From: Greg Kroah-Hartman Date: Wed, 5 Feb 2025 12:24:20 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v6.6.76~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01e7b97b1e2c353eba60eef3842f8f49a65b0acf;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: loongarch-change-8-to-14-for-loongarch_max_-brp-wrp.patch s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch --- diff --git a/queue-6.6/loongarch-change-8-to-14-for-loongarch_max_-brp-wrp.patch b/queue-6.6/loongarch-change-8-to-14-for-loongarch_max_-brp-wrp.patch new file mode 100644 index 0000000000..0c65d0c5a4 --- /dev/null +++ b/queue-6.6/loongarch-change-8-to-14-for-loongarch_max_-brp-wrp.patch @@ -0,0 +1,147 @@ +From f502ea618bf16d615d7dc6138c8988d3118fe750 Mon Sep 17 00:00:00 2001 +From: Tiezhu Yang +Date: Sun, 26 Jan 2025 21:49:59 +0800 +Subject: LoongArch: Change 8 to 14 for LOONGARCH_MAX_{BRP,WRP} + +From: Tiezhu Yang + +commit f502ea618bf16d615d7dc6138c8988d3118fe750 upstream. + +The maximum number of load/store watchpoints and fetch instruction +watchpoints is 14 each according to LoongArch Reference Manual, so +change 8 to 14 for the related code. + +Link: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#control-and-status-registers-related-to-watchpoints +Cc: stable@vger.kernel.org +Fixes: edffa33c7bb5 ("LoongArch: Add hardware breakpoints/watchpoints support") +Reviewed-by: WANG Xuerui +Signed-off-by: Tiezhu Yang +Signed-off-by: Huacai Chen +Signed-off-by: Greg Kroah-Hartman +--- + arch/loongarch/include/asm/hw_breakpoint.h | 4 - + arch/loongarch/include/asm/loongarch.h | 60 +++++++++++++++++++++++++++++ + arch/loongarch/kernel/hw_breakpoint.c | 16 ++++++- + 3 files changed, 76 insertions(+), 4 deletions(-) + +--- a/arch/loongarch/include/asm/hw_breakpoint.h ++++ b/arch/loongarch/include/asm/hw_breakpoint.h +@@ -38,8 +38,8 @@ struct arch_hw_breakpoint { + * Limits. + * Changing these will require modifications to the register accessors. + */ +-#define LOONGARCH_MAX_BRP 8 +-#define LOONGARCH_MAX_WRP 8 ++#define LOONGARCH_MAX_BRP 14 ++#define LOONGARCH_MAX_WRP 14 + + /* Virtual debug register bases. */ + #define CSR_CFG_ADDR 0 +--- a/arch/loongarch/include/asm/loongarch.h ++++ b/arch/loongarch/include/asm/loongarch.h +@@ -928,6 +928,36 @@ + #define LOONGARCH_CSR_DB7CTRL 0x34a /* data breakpoint 7 control */ + #define LOONGARCH_CSR_DB7ASID 0x34b /* data breakpoint 7 asid */ + ++#define LOONGARCH_CSR_DB8ADDR 0x350 /* data breakpoint 8 address */ ++#define LOONGARCH_CSR_DB8MASK 0x351 /* data breakpoint 8 mask */ ++#define LOONGARCH_CSR_DB8CTRL 0x352 /* data breakpoint 8 control */ ++#define LOONGARCH_CSR_DB8ASID 0x353 /* data breakpoint 8 asid */ ++ ++#define LOONGARCH_CSR_DB9ADDR 0x358 /* data breakpoint 9 address */ ++#define LOONGARCH_CSR_DB9MASK 0x359 /* data breakpoint 9 mask */ ++#define LOONGARCH_CSR_DB9CTRL 0x35a /* data breakpoint 9 control */ ++#define LOONGARCH_CSR_DB9ASID 0x35b /* data breakpoint 9 asid */ ++ ++#define LOONGARCH_CSR_DB10ADDR 0x360 /* data breakpoint 10 address */ ++#define LOONGARCH_CSR_DB10MASK 0x361 /* data breakpoint 10 mask */ ++#define LOONGARCH_CSR_DB10CTRL 0x362 /* data breakpoint 10 control */ ++#define LOONGARCH_CSR_DB10ASID 0x363 /* data breakpoint 10 asid */ ++ ++#define LOONGARCH_CSR_DB11ADDR 0x368 /* data breakpoint 11 address */ ++#define LOONGARCH_CSR_DB11MASK 0x369 /* data breakpoint 11 mask */ ++#define LOONGARCH_CSR_DB11CTRL 0x36a /* data breakpoint 11 control */ ++#define LOONGARCH_CSR_DB11ASID 0x36b /* data breakpoint 11 asid */ ++ ++#define LOONGARCH_CSR_DB12ADDR 0x370 /* data breakpoint 12 address */ ++#define LOONGARCH_CSR_DB12MASK 0x371 /* data breakpoint 12 mask */ ++#define LOONGARCH_CSR_DB12CTRL 0x372 /* data breakpoint 12 control */ ++#define LOONGARCH_CSR_DB12ASID 0x373 /* data breakpoint 12 asid */ ++ ++#define LOONGARCH_CSR_DB13ADDR 0x378 /* data breakpoint 13 address */ ++#define LOONGARCH_CSR_DB13MASK 0x379 /* data breakpoint 13 mask */ ++#define LOONGARCH_CSR_DB13CTRL 0x37a /* data breakpoint 13 control */ ++#define LOONGARCH_CSR_DB13ASID 0x37b /* data breakpoint 13 asid */ ++ + #define LOONGARCH_CSR_FWPC 0x380 /* instruction breakpoint config */ + #define LOONGARCH_CSR_FWPS 0x381 /* instruction breakpoint status */ + +@@ -971,6 +1001,36 @@ + #define LOONGARCH_CSR_IB7CTRL 0x3ca /* inst breakpoint 7 control */ + #define LOONGARCH_CSR_IB7ASID 0x3cb /* inst breakpoint 7 asid */ + ++#define LOONGARCH_CSR_IB8ADDR 0x3d0 /* inst breakpoint 8 address */ ++#define LOONGARCH_CSR_IB8MASK 0x3d1 /* inst breakpoint 8 mask */ ++#define LOONGARCH_CSR_IB8CTRL 0x3d2 /* inst breakpoint 8 control */ ++#define LOONGARCH_CSR_IB8ASID 0x3d3 /* inst breakpoint 8 asid */ ++ ++#define LOONGARCH_CSR_IB9ADDR 0x3d8 /* inst breakpoint 9 address */ ++#define LOONGARCH_CSR_IB9MASK 0x3d9 /* inst breakpoint 9 mask */ ++#define LOONGARCH_CSR_IB9CTRL 0x3da /* inst breakpoint 9 control */ ++#define LOONGARCH_CSR_IB9ASID 0x3db /* inst breakpoint 9 asid */ ++ ++#define LOONGARCH_CSR_IB10ADDR 0x3e0 /* inst breakpoint 10 address */ ++#define LOONGARCH_CSR_IB10MASK 0x3e1 /* inst breakpoint 10 mask */ ++#define LOONGARCH_CSR_IB10CTRL 0x3e2 /* inst breakpoint 10 control */ ++#define LOONGARCH_CSR_IB10ASID 0x3e3 /* inst breakpoint 10 asid */ ++ ++#define LOONGARCH_CSR_IB11ADDR 0x3e8 /* inst breakpoint 11 address */ ++#define LOONGARCH_CSR_IB11MASK 0x3e9 /* inst breakpoint 11 mask */ ++#define LOONGARCH_CSR_IB11CTRL 0x3ea /* inst breakpoint 11 control */ ++#define LOONGARCH_CSR_IB11ASID 0x3eb /* inst breakpoint 11 asid */ ++ ++#define LOONGARCH_CSR_IB12ADDR 0x3f0 /* inst breakpoint 12 address */ ++#define LOONGARCH_CSR_IB12MASK 0x3f1 /* inst breakpoint 12 mask */ ++#define LOONGARCH_CSR_IB12CTRL 0x3f2 /* inst breakpoint 12 control */ ++#define LOONGARCH_CSR_IB12ASID 0x3f3 /* inst breakpoint 12 asid */ ++ ++#define LOONGARCH_CSR_IB13ADDR 0x3f8 /* inst breakpoint 13 address */ ++#define LOONGARCH_CSR_IB13MASK 0x3f9 /* inst breakpoint 13 mask */ ++#define LOONGARCH_CSR_IB13CTRL 0x3fa /* inst breakpoint 13 control */ ++#define LOONGARCH_CSR_IB13ASID 0x3fb /* inst breakpoint 13 asid */ ++ + #define LOONGARCH_CSR_DEBUG 0x500 /* debug config */ + #define LOONGARCH_CSR_DERA 0x501 /* debug era */ + #define LOONGARCH_CSR_DESAVE 0x502 /* debug save */ +--- a/arch/loongarch/kernel/hw_breakpoint.c ++++ b/arch/loongarch/kernel/hw_breakpoint.c +@@ -51,7 +51,13 @@ int hw_breakpoint_slots(int type) + READ_WB_REG_CASE(OFF, 4, REG, T, VAL); \ + READ_WB_REG_CASE(OFF, 5, REG, T, VAL); \ + READ_WB_REG_CASE(OFF, 6, REG, T, VAL); \ +- READ_WB_REG_CASE(OFF, 7, REG, T, VAL); ++ READ_WB_REG_CASE(OFF, 7, REG, T, VAL); \ ++ READ_WB_REG_CASE(OFF, 8, REG, T, VAL); \ ++ READ_WB_REG_CASE(OFF, 9, REG, T, VAL); \ ++ READ_WB_REG_CASE(OFF, 10, REG, T, VAL); \ ++ READ_WB_REG_CASE(OFF, 11, REG, T, VAL); \ ++ READ_WB_REG_CASE(OFF, 12, REG, T, VAL); \ ++ READ_WB_REG_CASE(OFF, 13, REG, T, VAL); + + #define GEN_WRITE_WB_REG_CASES(OFF, REG, T, VAL) \ + WRITE_WB_REG_CASE(OFF, 0, REG, T, VAL); \ +@@ -61,7 +67,13 @@ int hw_breakpoint_slots(int type) + WRITE_WB_REG_CASE(OFF, 4, REG, T, VAL); \ + WRITE_WB_REG_CASE(OFF, 5, REG, T, VAL); \ + WRITE_WB_REG_CASE(OFF, 6, REG, T, VAL); \ +- WRITE_WB_REG_CASE(OFF, 7, REG, T, VAL); ++ WRITE_WB_REG_CASE(OFF, 7, REG, T, VAL); \ ++ WRITE_WB_REG_CASE(OFF, 8, REG, T, VAL); \ ++ WRITE_WB_REG_CASE(OFF, 9, REG, T, VAL); \ ++ WRITE_WB_REG_CASE(OFF, 10, REG, T, VAL); \ ++ WRITE_WB_REG_CASE(OFF, 11, REG, T, VAL); \ ++ WRITE_WB_REG_CASE(OFF, 12, REG, T, VAL); \ ++ WRITE_WB_REG_CASE(OFF, 13, REG, T, VAL); + + static u64 read_wb_reg(int reg, int n, int t) + { diff --git a/queue-6.6/s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch b/queue-6.6/s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch new file mode 100644 index 0000000000..1456beea96 --- /dev/null +++ b/queue-6.6/s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch @@ -0,0 +1,63 @@ +From 3b8b80e993766dc96d1a1c01c62f5d15fafc79b9 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 22 Jan 2025 19:54:27 -0700 +Subject: s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS + +From: Nathan Chancellor + +commit 3b8b80e993766dc96d1a1c01c62f5d15fafc79b9 upstream. + +GCC changed the default C standard dialect from gnu17 to gnu23, +which should not have impacted the kernel because it explicitly requests +the gnu11 standard in the main Makefile. However, there are certain +places in the s390 code that use their own CFLAGS without a '-std=' +value, which break with this dialect change because of the kernel's own +definitions of bool, false, and true conflicting with the C23 reserved +keywords. + + include/linux/stddef.h:11:9: error: cannot use keyword 'false' as enumeration constant + 11 | false = 0, + | ^~~~~ + include/linux/stddef.h:11:9: note: 'false' is a keyword with '-std=c23' onwards + include/linux/types.h:35:33: error: 'bool' cannot be defined via 'typedef' + 35 | typedef _Bool bool; + | ^~~~ + include/linux/types.h:35:33: note: 'bool' is a keyword with '-std=c23' onwards + +Add '-std=gnu11' to the decompressor and purgatory CFLAGS to eliminate +these errors and make the C standard version of these areas match the +rest of the kernel. + +Cc: stable@vger.kernel.org +Signed-off-by: Nathan Chancellor +Tested-by: Heiko Carstens +Link: https://lore.kernel.org/r/20250122-s390-fix-std-for-gcc-15-v1-1-8b00cadee083@kernel.org +Signed-off-by: Alexander Gordeev +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/Makefile | 2 +- + arch/s390/purgatory/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/s390/Makefile ++++ b/arch/s390/Makefile +@@ -21,7 +21,7 @@ KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FL + ifndef CONFIG_AS_IS_LLVM + KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf)) + endif +-KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack ++KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack -std=gnu11 + KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY + KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain + KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables +--- a/arch/s390/purgatory/Makefile ++++ b/arch/s390/purgatory/Makefile +@@ -21,7 +21,7 @@ UBSAN_SANITIZE := n + KASAN_SANITIZE := n + KCSAN_SANITIZE := n + +-KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes ++KBUILD_CFLAGS := -std=gnu11 -fno-strict-aliasing -Wall -Wstrict-prototypes + KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare + KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding + KBUILD_CFLAGS += -Os -m64 -msoft-float -fno-common diff --git a/queue-6.6/series b/queue-6.6/series index 01a135cf86..31d75647cd 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -389,3 +389,5 @@ usb-gadget-f_tcm-don-t-free-command-immediately.patch staging-media-max96712-fix-kernel-oops-when-removing-module.patch media-imx-jpeg-fix-potential-error-pointer-dereference-in-detach_pm.patch btrfs-output-the-reason-for-open_ctree-failure.patch +s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch +loongarch-change-8-to-14-for-loongarch_max_-brp-wrp.patch