All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
@ 2022-09-15 18:17 kernel test robot
  2022-09-15 18:49   ` Arnd Bergmann
  0 siblings, 1 reply; 10+ messages in thread
From: kernel test robot @ 2022-09-15 18:17 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel, Linus Walleij

Hi Arnd,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3245cb65fd91cd514801bf91f5a3066d562f0ac4
commit: 3d427228f7370894680580fcd0381c0349624fa1 ARM: ixp4xx: enable multiplatform support
date:   5 months ago
config: arm-randconfig-r035-20220915 (https://download.01.org/0day-ci/archive/20220916/202209160259.7f3Z5krO-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3d427228f7370894680580fcd0381c0349624fa1
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 3d427228f7370894680580fcd0381c0349624fa1
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/omapdrm/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/omapdrm/dss/dsi.c: In function 'dsi_dump_dsi_irqs':
>> drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
    1126 | }
         | ^
   In file included from include/linux/string.h:253,
                    from include/linux/bitmap.h:11,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rbtree.h:24,
                    from include/linux/regmap.h:14,
                    from drivers/gpu/drm/omapdrm/dss/dsi.c:11:
   In function 'fortify_memcpy_chk',
       inlined from 'omap_dsi_irq_handler' at drivers/gpu/drm/omapdrm/dss/dsi.c:460:2:
   include/linux/fortify-string.h:336:25: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
     336 |                         __read_overflow2_field(q_size_field, size);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +1126 drivers/gpu/drm/omapdrm/dss/dsi.c

a72b64b99918ee drivers/video/omap2/dss/dsi.c     Archit Taneja    2011-05-12  1124  
f33656e1fe5aba drivers/gpu/drm/omapdrm/dss/dsi.c Laurent Pinchart 2018-02-13  1125  	return 0;
5a8b572d832772 drivers/video/omap2/dss/dsi.c     Archit Taneja    2011-05-12 @1126  }
5a8b572d832772 drivers/video/omap2/dss/dsi.c     Archit Taneja    2011-05-12  1127  #endif
5a8b572d832772 drivers/video/omap2/dss/dsi.c     Archit Taneja    2011-05-12  1128  

:::::: The code at line 1126 was first introduced by commit
:::::: 5a8b572d832772722c3b3b7578e7fb968560fcf3 OMAP4: DSS2: DSI: Changes for DSI2 on OMAP4

:::::: TO: Archit Taneja <archit@ti.com>
:::::: CC: Tomi Valkeinen <tomi.valkeinen@ti.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
  2022-09-15 18:17 drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes kernel test robot
  2022-09-15 18:49   ` Arnd Bergmann
@ 2022-09-15 18:49   ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2022-09-15 18:49 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, linux-kernel, Linus Walleij, linux-omap,
	Tomi Valkeinen, dri-devel

On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
> Hi Arnd,
> tree:   
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   3245cb65fd91cd514801bf91f5a3066d562f0ac4
> commit: 3d427228f7370894680580fcd0381c0349624fa1 ARM: ixp4xx: enable 
> multiplatform support

This did not cause the problem, the bisection just landed on a
commit that enabled additional configuraitons.

>    drivers/gpu/drm/omapdrm/dss/dsi.c: In function 'dsi_dump_dsi_irqs':
>>> drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>     1126 | }

I think hte problem is that struct dsi_irq_stats is just too
large, at 776 bytes. The interrupts are disabled during a copy
from 'dsi->irq_stats' into 'stats'. A trivial workaround would
avoid the local copy and keep interrupts disabled through
the entire function so it can operate directly on the source
data, but that would introduce a longer time with irqs disabled,
which might be bad as well.

Since this is only called from a debugfs file, and reading that
file is probably not performance critical itself, maybe
using kmalloc on the large structure would be best.

       Arnd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
@ 2022-09-15 18:49   ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2022-09-15 18:49 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, linux-kernel, dri-devel, Tomi Valkeinen, linux-omap

On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
> Hi Arnd,
> tree:   
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   3245cb65fd91cd514801bf91f5a3066d562f0ac4
> commit: 3d427228f7370894680580fcd0381c0349624fa1 ARM: ixp4xx: enable 
> multiplatform support

This did not cause the problem, the bisection just landed on a
commit that enabled additional configuraitons.

>    drivers/gpu/drm/omapdrm/dss/dsi.c: In function 'dsi_dump_dsi_irqs':
>>> drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>     1126 | }

I think hte problem is that struct dsi_irq_stats is just too
large, at 776 bytes. The interrupts are disabled during a copy
from 'dsi->irq_stats' into 'stats'. A trivial workaround would
avoid the local copy and keep interrupts disabled through
the entire function so it can operate directly on the source
data, but that would introduce a longer time with irqs disabled,
which might be bad as well.

Since this is only called from a debugfs file, and reading that
file is probably not performance critical itself, maybe
using kmalloc on the large structure would be best.

       Arnd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
@ 2022-09-15 18:49   ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2022-09-15 18:49 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
> Hi Arnd,
> tree:   
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   3245cb65fd91cd514801bf91f5a3066d562f0ac4
> commit: 3d427228f7370894680580fcd0381c0349624fa1 ARM: ixp4xx: enable 
> multiplatform support

This did not cause the problem, the bisection just landed on a
commit that enabled additional configuraitons.

>    drivers/gpu/drm/omapdrm/dss/dsi.c: In function 'dsi_dump_dsi_irqs':
>>> drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>     1126 | }

I think hte problem is that struct dsi_irq_stats is just too
large, at 776 bytes. The interrupts are disabled during a copy
from 'dsi->irq_stats' into 'stats'. A trivial workaround would
avoid the local copy and keep interrupts disabled through
the entire function so it can operate directly on the source
data, but that would introduce a longer time with irqs disabled,
which might be bad as well.

Since this is only called from a debugfs file, and reading that
file is probably not performance critical itself, maybe
using kmalloc on the large structure would be best.

       Arnd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
  2022-09-15 18:49   ` Arnd Bergmann
  (?)
@ 2022-09-16  8:24     ` Tomi Valkeinen
  -1 siblings, 0 replies; 10+ messages in thread
From: Tomi Valkeinen @ 2022-09-16  8:24 UTC (permalink / raw)
  To: Arnd Bergmann, kernel test robot
  Cc: kbuild-all, linux-kernel, Linus Walleij, linux-omap,
	Tomi Valkeinen, dri-devel

On 15/09/2022 21:49, Arnd Bergmann wrote:
> On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
>> Hi Arnd,
>> tree:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> master
>> head:   3245cb65fd91cd514801bf91f5a3066d562f0ac4
>> commit: 3d427228f7370894680580fcd0381c0349624fa1 ARM: ixp4xx: enable
>> multiplatform support
> 
> This did not cause the problem, the bisection just landed on a
> commit that enabled additional configuraitons.
> 
>>     drivers/gpu/drm/omapdrm/dss/dsi.c: In function 'dsi_dump_dsi_irqs':
>>>> drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>>      1126 | }
> 
> I think hte problem is that struct dsi_irq_stats is just too
> large, at 776 bytes. The interrupts are disabled during a copy
> from 'dsi->irq_stats' into 'stats'. A trivial workaround would
> avoid the local copy and keep interrupts disabled through
> the entire function so it can operate directly on the source
> data, but that would introduce a longer time with irqs disabled,
> which might be bad as well.
> 
> Since this is only called from a debugfs file, and reading that
> file is probably not performance critical itself, maybe
> using kmalloc on the large structure would be best.

I think that makes sense. I have sent a patch using kmalloc.

Oddly enough, I was not able to reproduce the warning with my normal 
toolchain, gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf. I even 
reduced the frame size limit to 700, and saw warnings from other places, 
but not from omapdrm.

  Tomi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
@ 2022-09-16  8:24     ` Tomi Valkeinen
  0 siblings, 0 replies; 10+ messages in thread
From: Tomi Valkeinen @ 2022-09-16  8:24 UTC (permalink / raw)
  To: Arnd Bergmann, kernel test robot
  Cc: kbuild-all, linux-kernel, dri-devel, Tomi Valkeinen, linux-omap

On 15/09/2022 21:49, Arnd Bergmann wrote:
> On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
>> Hi Arnd,
>> tree:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> master
>> head:   3245cb65fd91cd514801bf91f5a3066d562f0ac4
>> commit: 3d427228f7370894680580fcd0381c0349624fa1 ARM: ixp4xx: enable
>> multiplatform support
> 
> This did not cause the problem, the bisection just landed on a
> commit that enabled additional configuraitons.
> 
>>     drivers/gpu/drm/omapdrm/dss/dsi.c: In function 'dsi_dump_dsi_irqs':
>>>> drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>>      1126 | }
> 
> I think hte problem is that struct dsi_irq_stats is just too
> large, at 776 bytes. The interrupts are disabled during a copy
> from 'dsi->irq_stats' into 'stats'. A trivial workaround would
> avoid the local copy and keep interrupts disabled through
> the entire function so it can operate directly on the source
> data, but that would introduce a longer time with irqs disabled,
> which might be bad as well.
> 
> Since this is only called from a debugfs file, and reading that
> file is probably not performance critical itself, maybe
> using kmalloc on the large structure would be best.

I think that makes sense. I have sent a patch using kmalloc.

Oddly enough, I was not able to reproduce the warning with my normal 
toolchain, gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf. I even 
reduced the frame size limit to 700, and saw warnings from other places, 
but not from omapdrm.

  Tomi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
@ 2022-09-16  8:24     ` Tomi Valkeinen
  0 siblings, 0 replies; 10+ messages in thread
From: Tomi Valkeinen @ 2022-09-16  8:24 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

On 15/09/2022 21:49, Arnd Bergmann wrote:
> On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
>> Hi Arnd,
>> tree:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> master
>> head:   3245cb65fd91cd514801bf91f5a3066d562f0ac4
>> commit: 3d427228f7370894680580fcd0381c0349624fa1 ARM: ixp4xx: enable
>> multiplatform support
> 
> This did not cause the problem, the bisection just landed on a
> commit that enabled additional configuraitons.
> 
>>     drivers/gpu/drm/omapdrm/dss/dsi.c: In function 'dsi_dump_dsi_irqs':
>>>> drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>>      1126 | }
> 
> I think hte problem is that struct dsi_irq_stats is just too
> large, at 776 bytes. The interrupts are disabled during a copy
> from 'dsi->irq_stats' into 'stats'. A trivial workaround would
> avoid the local copy and keep interrupts disabled through
> the entire function so it can operate directly on the source
> data, but that would introduce a longer time with irqs disabled,
> which might be bad as well.
> 
> Since this is only called from a debugfs file, and reading that
> file is probably not performance critical itself, maybe
> using kmalloc on the large structure would be best.

I think that makes sense. I have sent a patch using kmalloc.

Oddly enough, I was not able to reproduce the warning with my normal 
toolchain, gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf. I even 
reduced the frame size limit to 700, and saw warnings from other places, 
but not from omapdrm.

  Tomi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
  2022-09-16  8:24     ` Tomi Valkeinen
  (?)
@ 2022-09-16  8:52       ` Arnd Bergmann
  -1 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2022-09-16  8:52 UTC (permalink / raw)
  To: Tomi Valkeinen, kernel test robot
  Cc: kbuild-all, linux-kernel, dri-devel, Tomi Valkeinen, Linux-OMAP

On Fri, Sep 16, 2022, at 10:24 AM, Tomi Valkeinen wrote:
> On 15/09/2022 21:49, Arnd Bergmann wrote:
>> On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
>> I think hte problem is that struct dsi_irq_stats is just too
>> large, at 776 bytes. The interrupts are disabled during a copy
>> from 'dsi->irq_stats' into 'stats'. A trivial workaround would
>> avoid the local copy and keep interrupts disabled through
>> the entire function so it can operate directly on the source
>> data, but that would introduce a longer time with irqs disabled,
>> which might be bad as well.
>> 
>> Since this is only called from a debugfs file, and reading that
>> file is probably not performance critical itself, maybe
>> using kmalloc on the large structure would be best.
>
> I think that makes sense. I have sent a patch using kmalloc.
>
> Oddly enough, I was not able to reproduce the warning with my normal 
> toolchain, gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf. I even 
> reduced the frame size limit to 700, and saw warnings from other places, 
> but not from omapdrm.

I had another look and found that this only happens with
CONFIG_INIT_STACK_ALL_PATTERN=y or CONFIG_INIT_STACK_ALL_ZERO=y,
which are only available with gcc-12.x or clang.

It looks like without that, gcc can reduce the size of the
on-stack variable by only copying the members that it actually
needs, see https://pastebin.com/8dDRE1bX for the gcc-11
output.

      Arnd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
@ 2022-09-16  8:52       ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2022-09-16  8:52 UTC (permalink / raw)
  To: Tomi Valkeinen, kernel test robot
  Cc: kbuild-all, linux-kernel, Linus Walleij, Linux-OMAP,
	Tomi Valkeinen, dri-devel

On Fri, Sep 16, 2022, at 10:24 AM, Tomi Valkeinen wrote:
> On 15/09/2022 21:49, Arnd Bergmann wrote:
>> On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
>> I think hte problem is that struct dsi_irq_stats is just too
>> large, at 776 bytes. The interrupts are disabled during a copy
>> from 'dsi->irq_stats' into 'stats'. A trivial workaround would
>> avoid the local copy and keep interrupts disabled through
>> the entire function so it can operate directly on the source
>> data, but that would introduce a longer time with irqs disabled,
>> which might be bad as well.
>> 
>> Since this is only called from a debugfs file, and reading that
>> file is probably not performance critical itself, maybe
>> using kmalloc on the large structure would be best.
>
> I think that makes sense. I have sent a patch using kmalloc.
>
> Oddly enough, I was not able to reproduce the warning with my normal 
> toolchain, gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf. I even 
> reduced the frame size limit to 700, and saw warnings from other places, 
> but not from omapdrm.

I had another look and found that this only happens with
CONFIG_INIT_STACK_ALL_PATTERN=y or CONFIG_INIT_STACK_ALL_ZERO=y,
which are only available with gcc-12.x or clang.

It looks like without that, gcc can reduce the size of the
on-stack variable by only copying the members that it actually
needs, see https://pastebin.com/8dDRE1bX for the gcc-11
output.

      Arnd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes
@ 2022-09-16  8:52       ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2022-09-16  8:52 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]

On Fri, Sep 16, 2022, at 10:24 AM, Tomi Valkeinen wrote:
> On 15/09/2022 21:49, Arnd Bergmann wrote:
>> On Thu, Sep 15, 2022, at 8:17 PM, kernel test robot wrote:
>> I think hte problem is that struct dsi_irq_stats is just too
>> large, at 776 bytes. The interrupts are disabled during a copy
>> from 'dsi->irq_stats' into 'stats'. A trivial workaround would
>> avoid the local copy and keep interrupts disabled through
>> the entire function so it can operate directly on the source
>> data, but that would introduce a longer time with irqs disabled,
>> which might be bad as well.
>> 
>> Since this is only called from a debugfs file, and reading that
>> file is probably not performance critical itself, maybe
>> using kmalloc on the large structure would be best.
>
> I think that makes sense. I have sent a patch using kmalloc.
>
> Oddly enough, I was not able to reproduce the warning with my normal 
> toolchain, gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf. I even 
> reduced the frame size limit to 700, and saw warnings from other places, 
> but not from omapdrm.

I had another look and found that this only happens with
CONFIG_INIT_STACK_ALL_PATTERN=y or CONFIG_INIT_STACK_ALL_ZERO=y,
which are only available with gcc-12.x or clang.

It looks like without that, gcc can reduce the size of the
on-stack variable by only copying the members that it actually
needs, see https://pastebin.com/8dDRE1bX for the gcc-11
output.

      Arnd

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-09-16  8:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 18:17 drivers/gpu/drm/omapdrm/dss/dsi.c:1126:1: warning: the frame size of 1060 bytes is larger than 1024 bytes kernel test robot
2022-09-15 18:49 ` Arnd Bergmann
2022-09-15 18:49   ` Arnd Bergmann
2022-09-15 18:49   ` Arnd Bergmann
2022-09-16  8:24   ` Tomi Valkeinen
2022-09-16  8:24     ` Tomi Valkeinen
2022-09-16  8:24     ` Tomi Valkeinen
2022-09-16  8:52     ` Arnd Bergmann
2022-09-16  8:52       ` Arnd Bergmann
2022-09-16  8:52       ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.