From: Greg Kroah-Hartman Date: Thu, 17 Apr 2025 17:30:18 +0000 (+0200) Subject: 6.12-stable patches X-Git-Tag: v6.12.24~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c0694315b7f05f68140dc9990ec388b6b494947;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch --- diff --git a/queue-6.12/media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch b/queue-6.12/media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch new file mode 100644 index 0000000000..27ebfd7b4e --- /dev/null +++ b/queue-6.12/media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch @@ -0,0 +1,42 @@ +From 8b55f8818900c99dd4f55a59a103f5b29e41eb2c Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +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 + +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 +Reviewed-by: Nathan Chancellor +Signed-off-by: Sebastian Fricke +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c ++++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c +@@ -1188,7 +1188,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) diff --git a/queue-6.12/series b/queue-6.12/series index 5271b595b2..f753b66e7a 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -388,3 +388,4 @@ nfsd-don-t-ignore-the-return-code-of-svc_proc_register.patch x86-e820-fix-handling-of-subpage-regions-when-calculating-nosave-ranges-in-e820__register_nosave_regions.patch libbpf-prevent-compiler-warnings-errors.patch kbuild-add-fno-builtin-wcslen.patch +media-mediatek-vcodec-mark-vdec_vp9_slice_map_counts_eob_coef-noinline.patch