From: "Arnd Bergmann" <arnd@arndb.de>
To: "Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
"kernel test robot" <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
"Linux Memory Management List" <linux-mm@kvack.org>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
linux-media@vger.kernel.org,
"Nicolas Dufresne" <nicolas.dufresne@collabora.com>,
"Hans Verkuil" <hverkuil@xs4all.nl>
Subject: Re: [linux-next:master 7549/10326] drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:1022:1: warning: the frame size of 1112 bytes is larger than 1024 bytes
Date: Fri, 16 Jun 2023 13:49:26 +0200 [thread overview]
Message-ID: <c5f860ac-4bf7-46cd-aaec-f83ccbe4a6de@app.fastmail.com> (raw)
In-Reply-To: <8bd6a1d8-a464-dc43-9ea3-a32c7f490bc1@collabora.com>
On Thu, Jun 15, 2023, at 10:46, Benjamin Gaignard wrote:
> Le 15/06/2023 à 09:35, kernel test robot a écrit :
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202306151506.goHEegOd-lkp@intel.com/
>>
>> All warnings (new ones prefixed by >>):
>>
>> drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c: In function 'rockchip_vpu981_av1_dec_set_segmentation':
>>>> 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=]
>> 1022 | }
>> | ^
>
> Arnd have alreaday send a patch to solve this gcc issue:
> https://lore.kernel.org/lkml/20230601151832.3632525-1-arnd@kernel.org/
I just ran into the above issue with my workaround applied, so
I think this is caused by something else.
I can see one 256 byte variable that is a little too large to fit on the stack, but
that is not the main issue:
u32 segval[V4L2_AV1_MAX_SEGMENTS][V4L2_AV1_SEG_LVL_MAX] ;
The actual problem appears to be the construction of temporary arrays
on the stack like
#define AV1_DEC_REG(b, s, m) \
((const struct hantro_reg) { \
.base = AV1_SWREG(b), \
.shift = s, \
.mask = m, \
})
#define av1_dec_out_ec_bypass AV1_DEC_REG(3, 8, 0x1)
hantro_reg_write(vpu, &av1_dec_out_ec_bypass, 1);
Each one of these adds 12 bytes to the stack, and there are a lot
of them here. If KASAN_STACK is active, they cannot overlap, and
there is an addition redzone around each one, but the case I saw
does not use KASAN or UBSAN.
I've tried a few things like removing the debug printf in each
register access, but that did not help. Maybe you have some other
idea for how to simplify this code.
Arnd
prev parent reply other threads:[~2023-06-16 11:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 7:35 kernel test robot
2023-06-15 8:46 ` Benjamin Gaignard
2023-06-16 11:49 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c5f860ac-4bf7-46cd-aaec-f83ccbe4a6de@app.fastmail.com \
--to=arnd@arndb.de \
--cc=benjamin.gaignard@collabora.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox