diff --git a/patches/arm64/08f6554ff90ef189e6b8f0303e57005bddfdd6a7.patch b/patches/arm64/08f6554ff90ef189e6b8f0303e57005bddfdd6a7.patch deleted file mode 100644 index 0f350d9b..00000000 --- a/patches/arm64/08f6554ff90ef189e6b8f0303e57005bddfdd6a7.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 08f6554ff90ef189e6b8f0303e57005bddfdd6a7 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 - -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 ---- - arch/mips/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/mips/Makefile b/arch/mips/Makefile -index a7a4ee66a9d37..ef7b05ae92ceb 100644 ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -346,7 +346,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables - KBUILD_LDFLAGS += -m $(ld-emul) - - ifdef CONFIG_MIPS --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 --- -cgit - diff --git a/patches/arm64/43fc0a99906e04792786edf8534d8d58d1e9de0c.patch b/patches/arm64/43fc0a99906e04792786edf8534d8d58d1e9de0c.patch deleted file mode 100644 index e446b8fb..00000000 --- a/patches/arm64/43fc0a99906e04792786edf8534d8d58d1e9de0c.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 43fc0a99906e04792786edf8534d8d58d1e9de0c 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 - -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 ---- - scripts/Makefile.compiler | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler -index 437013f8def35..e31f18625fcf5 100644 ---- 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) --- -cgit - diff --git a/patches/arm64/7ee8acd1b803502878992acd6f99e61f1e8c7a25.patch b/patches/arm64/7ee8acd1b803502878992acd6f99e61f1e8c7a25.patch new file mode 100644 index 00000000..47fa348e --- /dev/null +++ b/patches/arm64/7ee8acd1b803502878992acd6f99e61f1e8c7a25.patch @@ -0,0 +1,140 @@ +From 7ee8acd1b803502878992acd6f99e61f1e8c7a25 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 16 Jun 2023 16:48:47 +0200 +Subject: media: verisilicon: fix excessive stack usage + +In some configurations, gcc decides not to inline the register accessor +functions, which in turn leads to lots of temporary hantro_reg structures +on the stack that cannot be eliminated because they escape into an +uninlined function: + +drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:1022:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=] + +Mark all of these as __always_inline so the compiler is able to completely +eliminate the temporary structures instead, which brings the stack usage +back down to just the normal local variables. + +Closes: https://lore.kernel.org/oe-kbuild-all/202306151506.goHEegOd-lkp@intel.com/ +[hverkuil: fix function prototype alignment, wrap commit log] + +Reported-by: kernel test robot +Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder") +Signed-off-by: Arnd Bergmann +Reviewed-by: Nicolas Dufresne +Tested-by: Nathan Chancellor +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +--- + drivers/media/platform/verisilicon/hantro.h | 42 ++++++++++++++--------------- + 1 file changed, 21 insertions(+), 21 deletions(-) + +diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h +index 6523ffb748812..1afec3df8c73b 100644 +--- a/drivers/media/platform/verisilicon/hantro.h ++++ b/drivers/media/platform/verisilicon/hantro.h +@@ -370,26 +370,26 @@ extern int hantro_debug; + pr_err("%s:%d: " fmt, __func__, __LINE__, ##args) + + /* Structure access helpers. */ +-static inline struct hantro_ctx *fh_to_ctx(struct v4l2_fh *fh) ++static __always_inline struct hantro_ctx *fh_to_ctx(struct v4l2_fh *fh) + { + return container_of(fh, struct hantro_ctx, fh); + } + + /* Register accessors. */ +-static inline void vepu_write_relaxed(struct hantro_dev *vpu, +- u32 val, u32 reg) ++static __always_inline void vepu_write_relaxed(struct hantro_dev *vpu, ++ u32 val, u32 reg) + { + vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val); + writel_relaxed(val, vpu->enc_base + reg); + } + +-static inline void vepu_write(struct hantro_dev *vpu, u32 val, u32 reg) ++static __always_inline void vepu_write(struct hantro_dev *vpu, u32 val, u32 reg) + { + vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val); + writel(val, vpu->enc_base + reg); + } + +-static inline u32 vepu_read(struct hantro_dev *vpu, u32 reg) ++static __always_inline u32 vepu_read(struct hantro_dev *vpu, u32 reg) + { + u32 val = readl(vpu->enc_base + reg); + +@@ -397,27 +397,27 @@ static inline u32 vepu_read(struct hantro_dev *vpu, u32 reg) + return val; + } + +-static inline void vdpu_write_relaxed(struct hantro_dev *vpu, +- u32 val, u32 reg) ++static __always_inline void vdpu_write_relaxed(struct hantro_dev *vpu, ++ u32 val, u32 reg) + { + vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val); + writel_relaxed(val, vpu->dec_base + reg); + } + +-static inline void vdpu_write(struct hantro_dev *vpu, u32 val, u32 reg) ++static __always_inline void vdpu_write(struct hantro_dev *vpu, u32 val, u32 reg) + { + vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val); + writel(val, vpu->dec_base + reg); + } + +-static inline void hantro_write_addr(struct hantro_dev *vpu, +- unsigned long offset, +- dma_addr_t addr) ++static __always_inline void hantro_write_addr(struct hantro_dev *vpu, ++ unsigned long offset, ++ dma_addr_t addr) + { + vdpu_write(vpu, addr & 0xffffffff, offset); + } + +-static inline u32 vdpu_read(struct hantro_dev *vpu, u32 reg) ++static __always_inline u32 vdpu_read(struct hantro_dev *vpu, u32 reg) + { + u32 val = readl(vpu->dec_base + reg); + +@@ -425,9 +425,9 @@ static inline u32 vdpu_read(struct hantro_dev *vpu, u32 reg) + return val; + } + +-static inline u32 vdpu_read_mask(struct hantro_dev *vpu, +- const struct hantro_reg *reg, +- u32 val) ++static __always_inline u32 vdpu_read_mask(struct hantro_dev *vpu, ++ const struct hantro_reg *reg, ++ u32 val) + { + u32 v; + +@@ -437,16 +437,16 @@ static inline u32 vdpu_read_mask(struct hantro_dev *vpu, + return v; + } + +-static inline void hantro_reg_write(struct hantro_dev *vpu, +- const struct hantro_reg *reg, +- u32 val) ++static __always_inline void hantro_reg_write(struct hantro_dev *vpu, ++ const struct hantro_reg *reg, ++ u32 val) + { + vdpu_write_relaxed(vpu, vdpu_read_mask(vpu, reg, val), reg->base); + } + +-static inline void hantro_reg_write_s(struct hantro_dev *vpu, +- const struct hantro_reg *reg, +- u32 val) ++static __always_inline void hantro_reg_write_s(struct hantro_dev *vpu, ++ const struct hantro_reg *reg, ++ u32 val) + { + vdpu_write(vpu, vdpu_read_mask(vpu, reg, val), reg->base); + } +-- +cgit + diff --git a/patches/arm64/a7e5eb53bf9b800d086e2ebcfebd9a3bb16bd1b0.patch b/patches/arm64/a7e5eb53bf9b800d086e2ebcfebd9a3bb16bd1b0.patch deleted file mode 100644 index 88b0429f..00000000 --- a/patches/arm64/a7e5eb53bf9b800d086e2ebcfebd9a3bb16bd1b0.patch +++ /dev/null @@ -1,38 +0,0 @@ -From a7e5eb53bf9b800d086e2ebcfebd9a3bb16bd1b0 Mon Sep 17 00:00:00 2001 -From: Nathan Chancellor -Date: Thu, 1 Jun 2023 11:46:33 -0700 -Subject: powerpc/vdso: Include CLANG_FLAGS explicitly in ldflags-y - -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 the compat -PowerPC vDSO: - - clang: error: unsupported option '-mbig-endian' for target 'x86_64-pc-linux-gnu' - make[3]: *** [.../arch/powerpc/kernel/vdso/Makefile:76: arch/powerpc/kernel/vdso/vdso32.so.dbg] Error 1 - -Explicitly add CLANG_FLAGS to ldflags-y, so that '--target' will always -be present. - -Signed-off-by: Nathan Chancellor -Signed-off-by: Masahiro Yamada ---- - arch/powerpc/kernel/vdso/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile -index 4c3f34485f08f..23d3caf27d6d4 100644 ---- a/arch/powerpc/kernel/vdso/Makefile -+++ b/arch/powerpc/kernel/vdso/Makefile -@@ -54,7 +54,7 @@ KASAN_SANITIZE := n - KCSAN_SANITIZE := n - - ccflags-y := -fno-common -fno-builtin --ldflags-y := -Wl,--hash-style=both -nostdlib -shared -z noexecstack -+ldflags-y := -Wl,--hash-style=both -nostdlib -shared -z noexecstack $(CLANG_FLAGS) - ldflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld) - # Filter flags that clang will warn are unused for linking - ldflags-y += $(filter-out $(CC_AUTO_VAR_INIT_ZERO_ENABLER) $(CC_FLAGS_FTRACE) -Wa$(comma)%, $(KBUILD_CFLAGS)) --- -cgit - diff --git a/patches/arm64/cff6e7f50bd315e5b39c4e46c704ac587ceb965f.patch b/patches/arm64/cff6e7f50bd315e5b39c4e46c704ac587ceb965f.patch deleted file mode 100644 index 715ffce4..00000000 --- a/patches/arm64/cff6e7f50bd315e5b39c4e46c704ac587ceb965f.patch +++ /dev/null @@ -1,42 +0,0 @@ -From cff6e7f50bd315e5b39c4e46c704ac587ceb965f 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 - -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 ---- - scripts/Makefile.compiler | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler -index 7aa1fbc4aafef..437013f8def35 100644 ---- 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) --- -cgit - diff --git a/patches/arm64/feb843a469fb0ab00d2d23cfb9bcc379791011bb.patch b/patches/arm64/feb843a469fb0ab00d2d23cfb9bcc379791011bb.patch deleted file mode 100644 index c542c6db..00000000 --- a/patches/arm64/feb843a469fb0ab00d2d23cfb9bcc379791011bb.patch +++ /dev/null @@ -1,50 +0,0 @@ -From feb843a469fb0ab00d2d23cfb9bcc379791011bb 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 - -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 ---- - scripts/Makefile.clang | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang -index 9076cc939e874..058a4c0f864ec 100644 ---- a/scripts/Makefile.clang -+++ b/scripts/Makefile.clang -@@ -34,6 +34,5 @@ CLANG_FLAGS += -Werror=unknown-warning-option - CLANG_FLAGS += -Werror=ignored-optimization-argument - CLANG_FLAGS += -Werror=option-ignored - CLANG_FLAGS += -Werror=unused-command-line-argument --KBUILD_CFLAGS += $(CLANG_FLAGS) --KBUILD_AFLAGS += $(CLANG_FLAGS) -+KBUILD_CPPFLAGS += $(CLANG_FLAGS) - export CLANG_FLAGS --- -cgit - diff --git a/patches/arm64/series b/patches/arm64/series index bbda08b4..feab5cd7 100644 --- a/patches/arm64/series +++ b/patches/arm64/series @@ -1,5 +1 @@ -08f6554ff90ef189e6b8f0303e57005bddfdd6a7.patch -a7e5eb53bf9b800d086e2ebcfebd9a3bb16bd1b0.patch -cff6e7f50bd315e5b39c4e46c704ac587ceb965f.patch -feb843a469fb0ab00d2d23cfb9bcc379791011bb.patch -43fc0a99906e04792786edf8534d8d58d1e9de0c.patch +7ee8acd1b803502878992acd6f99e61f1e8c7a25.patch