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 Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202306151506.goHEegOd-lkp@xxxxxxxxx/
>>
>> 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@xxxxxxxxxx/

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




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux