linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 11080/11173] drivers/media/common/saa7146/saa7146_hlp.c:648:5: warning: stack frame size of 1072 bytes in function 'saa7146_enable_overlay'
@ 2020-09-27 20:13 kernel test robot
  2020-09-28  7:03 ` Marco Elver
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-09-27 20:13 UTC (permalink / raw)
  To: George Popescu
  Cc: kbuild-all, clang-built-linux, David Brazdil, Marco Elver,
	Andrew Morton, Linux Memory Management List

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   20dc779fdefc40bf7dd9736cea01704f29228fae
commit: 2ce416ba162877d5cf267ac35548ea45eba84150 [11080/11173] ubsan: introduce CONFIG_UBSAN_LOCAL_BOUNDS for Clang
config: powerpc-randconfig-r004-20200927 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6d374cf78c8a80a0bbfc7ce9bc80b3f183f44c80)
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
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2ce416ba162877d5cf267ac35548ea45eba84150
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 2ce416ba162877d5cf267ac35548ea45eba84150
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

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

All warnings (new ones prefixed by >>):

>> drivers/media/common/saa7146/saa7146_hlp.c:648:5: warning: stack frame size of 1072 bytes in function 'saa7146_enable_overlay' [-Wframe-larger-than=]
   int saa7146_enable_overlay(struct saa7146_fh *fh)
       ^
   1 warning generated.

vim +/saa7146_enable_overlay +648 drivers/media/common/saa7146/saa7146_hlp.c

^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  647  
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16 @648  int saa7146_enable_overlay(struct saa7146_fh *fh)
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  649  {
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  650  	struct saa7146_dev *dev = fh->dev;
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  651  	struct saa7146_vv *vv = dev->vv_data;
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  652  
5da545ad08a3c6 drivers/media/common/saa7146_hlp.c Hans Verkuil   2012-05-01  653  	saa7146_set_window(dev, vv->ov.win.w.width, vv->ov.win.w.height, vv->ov.win.field);
5da545ad08a3c6 drivers/media/common/saa7146_hlp.c Hans Verkuil   2012-05-01  654  	saa7146_set_position(dev, vv->ov.win.w.left, vv->ov.win.w.top, vv->ov.win.w.height, vv->ov.win.field, vv->ov_fmt->pixelformat);
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  655  	saa7146_set_output_format(dev, vv->ov_fmt->trans);
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  656  	saa7146_set_clipping_rect(fh);
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  657  
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  658  	/* enable video dma1 */
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  659  	saa7146_write(dev, MC1, (MASK_06 | MASK_22));
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  660  	return 0;
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  661  }
^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  662  

:::::: The code at line 648 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29936 bytes --]

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

* Re: [linux-next:master 11080/11173] drivers/media/common/saa7146/saa7146_hlp.c:648:5: warning: stack frame size of 1072 bytes in function 'saa7146_enable_overlay'
  2020-09-27 20:13 [linux-next:master 11080/11173] drivers/media/common/saa7146/saa7146_hlp.c:648:5: warning: stack frame size of 1072 bytes in function 'saa7146_enable_overlay' kernel test robot
@ 2020-09-28  7:03 ` Marco Elver
  2020-09-28 17:56   ` Nick Desaulniers
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Elver @ 2020-09-28  7:03 UTC (permalink / raw)
  To: kernel test robot
  Cc: George Popescu, kbuild-all, clang-built-linux, David Brazdil,
	Andrew Morton, Linux Memory Management List

On Sun, 27 Sep 2020 at 22:14, kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   20dc779fdefc40bf7dd9736cea01704f29228fae
> commit: 2ce416ba162877d5cf267ac35548ea45eba84150 [11080/11173] ubsan: introduce CONFIG_UBSAN_LOCAL_BOUNDS for Clang
> config: powerpc-randconfig-r004-20200927 (attached as .config)
> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6d374cf78c8a80a0bbfc7ce9bc80b3f183f44c80)
> 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
>         # install powerpc cross compiling tool for clang build
>         # apt-get install binutils-powerpc-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2ce416ba162877d5cf267ac35548ea45eba84150
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 2ce416ba162877d5cf267ac35548ea45eba84150
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/media/common/saa7146/saa7146_hlp.c:648:5: warning: stack frame size of 1072 bytes in function 'saa7146_enable_overlay' [-Wframe-larger-than=]
>    int saa7146_enable_overlay(struct saa7146_fh *fh)
>        ^
>    1 warning generated.

This warning must have existed before, because the UBSAN patch didn't
add any features, it just guarded them with extra Kconfig options.

Also, this is with Clang 12, which is very much in development and
quite unstable.

> vim +/saa7146_enable_overlay +648 drivers/media/common/saa7146/saa7146_hlp.c
>
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  647
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16 @648  int saa7146_enable_overlay(struct saa7146_fh *fh)
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  649  {
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  650        struct saa7146_dev *dev = fh->dev;
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  651        struct saa7146_vv *vv = dev->vv_data;
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  652
> 5da545ad08a3c6 drivers/media/common/saa7146_hlp.c Hans Verkuil   2012-05-01  653        saa7146_set_window(dev, vv->ov.win.w.width, vv->ov.win.w.height, vv->ov.win.field);
> 5da545ad08a3c6 drivers/media/common/saa7146_hlp.c Hans Verkuil   2012-05-01  654        saa7146_set_position(dev, vv->ov.win.w.left, vv->ov.win.w.top, vv->ov.win.w.height, vv->ov.win.field, vv->ov_fmt->pixelformat);
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  655        saa7146_set_output_format(dev, vv->ov_fmt->trans);
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  656        saa7146_set_clipping_rect(fh);
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  657
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  658        /* enable video dma1 */
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  659        saa7146_write(dev, MC1, (MASK_06 | MASK_22));
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  660        return 0;
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  661  }
> ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  662
>
> :::::: The code at line 648 was first introduced by commit
> :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
>
> :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
> :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


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

* Re: [linux-next:master 11080/11173] drivers/media/common/saa7146/saa7146_hlp.c:648:5: warning: stack frame size of 1072 bytes in function 'saa7146_enable_overlay'
  2020-09-28  7:03 ` Marco Elver
@ 2020-09-28 17:56   ` Nick Desaulniers
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2020-09-28 17:56 UTC (permalink / raw)
  To: Marco Elver
  Cc: kernel test robot, George Popescu, kbuild-all, clang-built-linux,
	David Brazdil, Andrew Morton, Linux Memory Management List

On Mon, Sep 28, 2020 at 12:03 AM 'Marco Elver' via Clang Built Linux
<clang-built-linux@googlegroups.com> wrote:
>
> On Sun, 27 Sep 2020 at 22:14, kernel test robot <lkp@intel.com> wrote:
> >
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head:   20dc779fdefc40bf7dd9736cea01704f29228fae
> > commit: 2ce416ba162877d5cf267ac35548ea45eba84150 [11080/11173] ubsan: introduce CONFIG_UBSAN_LOCAL_BOUNDS for Clang
> > config: powerpc-randconfig-r004-20200927 (attached as .config)

^ randconfig

> > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6d374cf78c8a80a0bbfc7ce9bc80b3f183f44c80)
> > 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
> >         # install powerpc cross compiling tool for clang build
> >         # apt-get install binutils-powerpc-linux-gnu
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2ce416ba162877d5cf267ac35548ea45eba84150
> >         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> >         git fetch --no-tags linux-next master
> >         git checkout 2ce416ba162877d5cf267ac35548ea45eba84150
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> >
> > All warnings (new ones prefixed by >>):
> >
> > >> drivers/media/common/saa7146/saa7146_hlp.c:648:5: warning: stack frame size of 1072 bytes in function 'saa7146_enable_overlay' [-Wframe-larger-than=]
> >    int saa7146_enable_overlay(struct saa7146_fh *fh)
> >        ^
> >    1 warning generated.
>
> This warning must have existed before, because the UBSAN patch didn't
> add any features, it just guarded them with extra Kconfig options.

Likely.

>
> Also, this is with Clang 12, which is very much in development and
> quite unstable.

I wrote a tool that can help debug these:
https://github.com/ClangBuiltLinux/frame-larger-than

The compiler is quite unhelpful in the warning; but recompiling with
debug info gives you info about stack slots and the size of those
types.  This is a randconfig, so always weird things get pulled in.
Sometimes these are large stack allocations that should be heap
allocated; sometimes it's KASAN enabled via randconfig.  I noticed
that KASAN+clang has pretty poor stack slot reuse, which triggers
these often: https://github.com/ClangBuiltLinux/linux/issues/39  I
didn't check this config to see if KASAN was set or not, but I
wouldn't chalk it up to "clang 12 being unstable."

>
> > vim +/saa7146_enable_overlay +648 drivers/media/common/saa7146/saa7146_hlp.c
> >
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  647
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16 @648  int saa7146_enable_overlay(struct saa7146_fh *fh)
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  649  {
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  650        struct saa7146_dev *dev = fh->dev;
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  651        struct saa7146_vv *vv = dev->vv_data;
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  652
> > 5da545ad08a3c6 drivers/media/common/saa7146_hlp.c Hans Verkuil   2012-05-01  653        saa7146_set_window(dev, vv->ov.win.w.width, vv->ov.win.w.height, vv->ov.win.field);
> > 5da545ad08a3c6 drivers/media/common/saa7146_hlp.c Hans Verkuil   2012-05-01  654        saa7146_set_position(dev, vv->ov.win.w.left, vv->ov.win.w.top, vv->ov.win.w.height, vv->ov.win.field, vv->ov_fmt->pixelformat);
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  655        saa7146_set_output_format(dev, vv->ov_fmt->trans);
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  656        saa7146_set_clipping_rect(fh);
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  657
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  658        /* enable video dma1 */
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  659        saa7146_write(dev, MC1, (MASK_06 | MASK_22));
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  660        return 0;
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  661  }
> > ^1da177e4c3f41 drivers/media/common/saa7146_hlp.c Linus Torvalds 2005-04-16  662
> >
> > :::::: The code at line 648 was first introduced by commit
> > :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
> >
> > :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
> > :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/CANpmjNNcRCipPdd0C0z-dxb1nfz35bkgAY6eJwGF8sYq%3D2wOqQ%40mail.gmail.com.



-- 
Thanks,
~Nick Desaulniers


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

end of thread, other threads:[~2020-09-28 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-27 20:13 [linux-next:master 11080/11173] drivers/media/common/saa7146/saa7146_hlp.c:648:5: warning: stack frame size of 1072 bytes in function 'saa7146_enable_overlay' kernel test robot
2020-09-28  7:03 ` Marco Elver
2020-09-28 17:56   ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).