Skip to content

Commit b683828

Browse files
committed
patches: 6.12: Apply 8b55f8818900c99dd4f55a59a103f5b29e41eb2c
This should have been transferred to 6.12 properly during the 6.12 and 6.13 update/split but I missed it. Signed-off-by: Nathan Chancellor <[email protected]>
1 parent bcea683 commit b683828

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From 8b55f8818900c99dd4f55a59a103f5b29e41eb2c Mon Sep 17 00:00:00 2001
2+
From: Arnd Bergmann <[email protected]>
3+
Date: Fri, 18 Oct 2024 15:14:42 +0000
4+
Subject: media: mediatek: vcodec: mark vdec_vp9_slice_map_counts_eob_coef
5+
noinline
6+
7+
With KASAN enabled, clang fails to optimize the inline version of
8+
vdec_vp9_slice_map_counts_eob_coef() properly, leading to kilobytes
9+
of temporary values spilled to the stack:
10+
11+
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]
12+
13+
This seems to affect all versions of clang including the latest (clang-20),
14+
but the degree of stack overhead is different per release.
15+
16+
Marking the function as noinline_for_stack is harmless here and avoids
17+
the problem completely.
18+
19+
Signed-off-by: Arnd Bergmann <[email protected]>
20+
Reviewed-by: Nathan Chancellor <[email protected]>
21+
Signed-off-by: Sebastian Fricke <[email protected]>
22+
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
23+
---
24+
Link: https://git.linuxtv.org/media.git/commit/?id=8b55f8818900c99dd4f55a59a103f5b29e41eb2c
25+
---
26+
.../media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 3 ++-
27+
1 file changed, 2 insertions(+), 1 deletion(-)
28+
29+
diff --git 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
30+
index eea709d93820..47c302745c1d 100644
31+
--- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
32+
+++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
33+
@@ -1188,7 +1188,8 @@ err:
34+
return ret;
35+
}
36+
37+
-static
38+
+/* clang stack usage explodes if this is inlined */
39+
+static noinline_for_stack
40+
void vdec_vp9_slice_map_counts_eob_coef(unsigned int i, unsigned int j, unsigned int k,
41+
struct vdec_vp9_slice_frame_counts *counts,
42+
struct v4l2_vp9_frame_symbol_counts *counts_helper)
43+
--
44+
cgit v1.2.3
45+

patches/6.12/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch
12
20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch

0 commit comments

Comments
 (0)