Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1337371 > unrolled thread

[PATCH 5/9] ARM: atags_to_fdt: don't warn about stack size

Started byArnd Bergmann <arnd@arndb.de>
First post2016-02-18 15:10 +0100
Last post2016-02-19 18:00 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 5/9] ARM: atags_to_fdt: don't warn about stack size Arnd Bergmann <arnd@arndb.de> - 2016-02-18 15:10 +0100
    Re: [PATCH 5/9] ARM: atags_to_fdt: don't warn about stack size Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-02-18 17:20 +0100
      [PATCH v2] ARM: atags_to_fdt: don't warn about stack size Arnd Bergmann <arnd@arndb.de> - 2016-02-18 17:30 +0100
        Re: [PATCH v2] ARM: atags_to_fdt: don't warn about stack size Arnd Bergmann <arnd@arndb.de> - 2016-02-19 18:00 +0100

#1337371 — [PATCH 5/9] ARM: atags_to_fdt: don't warn about stack size

FromArnd Bergmann <arnd@arndb.de>
Date2016-02-18 15:10 +0100
Subject[PATCH 5/9] ARM: atags_to_fdt: don't warn about stack size
Message-ID<r3xrk-6Oj-17@gated-at.bofh.it>
The merge_fdt_bootargs() function by definition consumes more than 1024
bytes of stack because it has a 1024 byte command line on the stack,
meaning that we always get a warning when building this file:

arch/arm/boot/compressed/atags_to_fdt.c: In function 'merge_fdt_bootargs':
arch/arm/boot/compressed/atags_to_fdt.c:98:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]

However, as this is the decompressor and we know that it has a very shallow
call chain, and we do not actually risk overflowing the kernel stack
at runtime here.

This just shuts up the warning by disabling the warning flag for this
file.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/boot/compressed/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 7a6a58ef8aaf..b5db4c868640 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -85,6 +85,8 @@ $(addprefix $(obj)/,$(libfdt) $(libfdt_hdrs)): $(obj)/%: $(srctree)/scripts/dtc/
 $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \
 	$(addprefix $(obj)/,$(libfdt_hdrs))
 
+CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
+
 ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
 OBJS	+= $(libfdt_objs) atags_to_fdt.o
 endif
-- 
2.7.0

[toc] | [next] | [standalone]


#1337503

FromNicolas Pitre <nicolas.pitre@linaro.org>
Date2016-02-18 17:20 +0100
Message-ID<r3zta-88d-41@gated-at.bofh.it>
In reply to#1337371
On Thu, 18 Feb 2016, Arnd Bergmann wrote:

> The merge_fdt_bootargs() function by definition consumes more than 1024
> bytes of stack because it has a 1024 byte command line on the stack,
> meaning that we always get a warning when building this file:
> 
> arch/arm/boot/compressed/atags_to_fdt.c: In function 'merge_fdt_bootargs':
> arch/arm/boot/compressed/atags_to_fdt.c:98:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> However, as this is the decompressor and we know that it has a very shallow
> call chain, and we do not actually risk overflowing the kernel stack
> at runtime here.
> 
> This just shuts up the warning by disabling the warning flag for this
> file.

What about setting the warning to 2048 instead?



> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/boot/compressed/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
> index 7a6a58ef8aaf..b5db4c868640 100644
> --- a/arch/arm/boot/compressed/Makefile
> +++ b/arch/arm/boot/compressed/Makefile
> @@ -85,6 +85,8 @@ $(addprefix $(obj)/,$(libfdt) $(libfdt_hdrs)): $(obj)/%: $(srctree)/scripts/dtc/
>  $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \
>  	$(addprefix $(obj)/,$(libfdt_hdrs))
>  
> +CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
> +
>  ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
>  OBJS	+= $(libfdt_objs) atags_to_fdt.o
>  endif
> -- 
> 2.7.0
> 
> 

[toc] | [prev] | [next] | [standalone]


#1337506 — [PATCH v2] ARM: atags_to_fdt: don't warn about stack size

FromArnd Bergmann <arnd@arndb.de>
Date2016-02-18 17:30 +0100
Subject[PATCH v2] ARM: atags_to_fdt: don't warn about stack size
Message-ID<r3zCP-8go-3@gated-at.bofh.it>
In reply to#1337503
The merge_fdt_bootargs() function by definition consumes more than 1024
bytes of stack because it has a 1024 byte command line on the stack,
meaning that we always get a warning when building this file:

arch/arm/boot/compressed/atags_to_fdt.c: In function 'merge_fdt_bootargs':
arch/arm/boot/compressed/atags_to_fdt.c:98:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]

However, as this is the decompressor and we know that it has a very shallow
call chain, and we do not actually risk overflowing the kernel stack
at runtime here.

This just shuts up the warning by slightly increasing the limit for this
file.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
On Thursday 18 February 2016 11:13:52 Nicolas Pitre wrote:
> What about setting the warning to 2048 instead?

Sure, actually 1280 is more than enough I think.

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 7a6a58ef8aaf..2cc63038d6c8 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -85,6 +85,8 @@ $(addprefix $(obj)/,$(libfdt) $(libfdt_hdrs)): $(obj)/%: $(srctree)/scripts/dtc/
 $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \
 	$(addprefix $(obj)/,$(libfdt_hdrs))
 
+CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280
+
 ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
 OBJS	+= $(libfdt_objs) atags_to_fdt.o
 endif

[toc] | [prev] | [next] | [standalone]


#1338356 — Re: [PATCH v2] ARM: atags_to_fdt: don't warn about stack size

FromArnd Bergmann <arnd@arndb.de>
Date2016-02-19 18:00 +0100
SubjectRe: [PATCH v2] ARM: atags_to_fdt: don't warn about stack size
Message-ID<r3Wzp-82f-23@gated-at.bofh.it>
In reply to#1337506
On Thursday 18 February 2016 17:26:56 Arnd Bergmann wrote:
> On Thursday 18 February 2016 11:13:52 Nicolas Pitre wrote:
> > What about setting the warning to 2048 instead?
> 
> Sure, actually 1280 is more than enough I think.
> 
It turns out that doesn't fix the problem though, as the new
argument gets prepended and the existing flag overrides it.

I have modified the patch now to do both:

CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280

	Arnd

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web