]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Apr 2025 07:28:21 +0000 (09:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Apr 2025 07:28:21 +0000 (09:28 +0200)
added patches:
media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch

queue-6.1/media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch b/queue-6.1/media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch
new file mode 100644 (file)
index 0000000..f9c3147
--- /dev/null
@@ -0,0 +1,44 @@
+From 062b81d06d45f6ef9b9045a6fd3b4359bb80e481 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Fri, 18 Oct 2024 15:14:42 +0000
+Subject: media: mediatek: vcodec: mark vdec_vp9_slice_map_counts_eob_coef noinline
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 8b55f8818900c99dd4f55a59a103f5b29e41eb2c upstream.
+
+With KASAN enabled, clang fails to optimize the inline version of
+vdec_vp9_slice_map_counts_eob_coef() properly, leading to kilobytes
+of temporary values spilled to the stack:
+
+drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c:1526:12: error: stack frame size (2160) exceeds limit (2048) in 'vdec_vp9_slice_update_prob' [-Werror,-Wframe-larger-than]
+
+This seems to affect all versions of clang including the latest (clang-20),
+but the degree of stack overhead is different per release.
+
+Marking the function as noinline_for_stack is harmless here and avoids
+the problem completely.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Reviewed-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+[nathan: Handle file location change in older trees]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c
++++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c
+@@ -1192,7 +1192,8 @@ err:
+       return ret;
+ }
+-static
++/* clang stack usage explodes if this is inlined */
++static noinline_for_stack
+ void vdec_vp9_slice_map_counts_eob_coef(unsigned int i, unsigned int j, unsigned int k,
+                                       struct vdec_vp9_slice_frame_counts *counts,
+                                       struct v4l2_vp9_frame_symbol_counts *counts_helper)
index 41630ca3b1d44fd4a80c4890ca40f04bf4918f59..d6a7e860c660b328f752127491bd663b5327e233 100644 (file)
@@ -258,3 +258,4 @@ kvm-arm64-calculate-cptr_el2-traps-on-activating-traps.patch
 kvm-arm64-eagerly-switch-zcr_el-1-2.patch
 cpufreq-reference-count-policy-in-cpufreq_update_limits.patch
 kbuild-add-fno-builtin-wcslen.patch
+media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch