LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ARM: atags_to_fdt: don't warn about stack size
@ 2021-08-09 15:10 David Heidelberg
2021-08-09 15:24 ` Russell King (Oracle)
2021-08-09 15:25 ` Nicolas Pitre
0 siblings, 2 replies; 5+ messages in thread
From: David Heidelberg @ 2021-08-09 15:10 UTC (permalink / raw)
To: Arnd Bergmann, Jon Medhurst, Russell King, Ard Biesheuvel,
Marc Zyngier, Nicolas Pitre
Cc: David Heidelberg, linux-kernel, linux-arm-kernel
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.
Tested on Nexus 7 2012 builds.
Original Author: Arnd Bergmann <arnd@arndb.de>
Reference: https://lore.kernel.org/lkml/8232115.18ykgQ6J5T@wuerfel/
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nicolas Pitre <nico@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: David Heidelberg <david@ixit.cz>
---
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 9d91ae1091b0..91265e7ff672 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -85,6 +85,8 @@ compress-$(CONFIG_KERNEL_LZ4) = lz4
libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o
ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
+CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
+CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280
OBJS += $(libfdt_objs) atags_to_fdt.o
endif
ifeq ($(CONFIG_USE_OF),y)
--
2.30.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: atags_to_fdt: don't warn about stack size
2021-08-09 15:10 [PATCH] ARM: atags_to_fdt: don't warn about stack size David Heidelberg
@ 2021-08-09 15:24 ` Russell King (Oracle)
2021-08-09 16:02 ` Arnd Bergmann
2021-08-09 15:25 ` Nicolas Pitre
1 sibling, 1 reply; 5+ messages in thread
From: Russell King (Oracle) @ 2021-08-09 15:24 UTC (permalink / raw)
To: David Heidelberg
Cc: Arnd Bergmann, Jon Medhurst, Ard Biesheuvel, Marc Zyngier,
Nicolas Pitre, linux-kernel, linux-arm-kernel
On Mon, Aug 09, 2021 at 05:10:21PM +0200, David Heidelberg 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.
>
> Tested on Nexus 7 2012 builds.
>
> Original Author: Arnd Bergmann <arnd@arndb.de>
> Reference: https://lore.kernel.org/lkml/8232115.18ykgQ6J5T@wuerfel/
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Nicolas Pitre <nico@linaro.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
>
> Signed-off-by: David Heidelberg <david@ixit.cz>
I assume Arnd never sent his v3 from what I see in the thread you link
to above.
This needs to go to the patch system to be applied. Details in my
signature below. Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: atags_to_fdt: don't warn about stack size
2021-08-09 15:10 [PATCH] ARM: atags_to_fdt: don't warn about stack size David Heidelberg
2021-08-09 15:24 ` Russell King (Oracle)
@ 2021-08-09 15:25 ` Nicolas Pitre
1 sibling, 0 replies; 5+ messages in thread
From: Nicolas Pitre @ 2021-08-09 15:25 UTC (permalink / raw)
To: David Heidelberg
Cc: Arnd Bergmann, Jon Medhurst, Russell King, Ard Biesheuvel,
Marc Zyngier, linux-kernel, linux-arm-kernel
On Mon, 9 Aug 2021, David Heidelberg 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.
>
> Tested on Nexus 7 2012 builds.
>
> Original Author: Arnd Bergmann <arnd@arndb.de>
> Reference: https://lore.kernel.org/lkml/8232115.18ykgQ6J5T@wuerfel/
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Nicolas Pitre <nico@linaro.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
>
> Signed-off-by: David Heidelberg <david@ixit.cz>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
> ---
> 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 9d91ae1091b0..91265e7ff672 100644
> --- a/arch/arm/boot/compressed/Makefile
> +++ b/arch/arm/boot/compressed/Makefile
> @@ -85,6 +85,8 @@ compress-$(CONFIG_KERNEL_LZ4) = lz4
> libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o
>
> ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
> +CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
> +CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280
> OBJS += $(libfdt_objs) atags_to_fdt.o
> endif
> ifeq ($(CONFIG_USE_OF),y)
> --
> 2.30.2
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: atags_to_fdt: don't warn about stack size
2021-08-09 15:24 ` Russell King (Oracle)
@ 2021-08-09 16:02 ` Arnd Bergmann
2021-08-09 16:44 ` David Heidelberg
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2021-08-09 16:02 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: David Heidelberg, Arnd Bergmann, Jon Medhurst, Ard Biesheuvel,
Marc Zyngier, Nicolas Pitre, Linux Kernel Mailing List,
Linux ARM
On Mon, Aug 9, 2021 at 5:24 PM Russell King (Oracle)
<linux@armlinux.org.uk> wrote:
> On Mon, Aug 09, 2021 at 05:10:21PM +0200, David Heidelberg wrote:
> > Signed-off-by: David Heidelberg <david@ixit.cz>
Acked-by: Arnd Bergmann <arnd@arndb.de>
(or keep my original Signed-off-by if you like)
> I assume Arnd never sent his v3 from what I see in the thread you link
> to above.
Yes, it's in my ever-growing backlog of things I plan to eventually resubmit.
In this case, I actually have a different patch in my tree, but that in turn
depends on other stuff I have to submit first (reorganizing the way that
warning options get handled based on compiler version etc), and the
version here is what works on current mainline kernels.
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: atags_to_fdt: don't warn about stack size
2021-08-09 16:02 ` Arnd Bergmann
@ 2021-08-09 16:44 ` David Heidelberg
0 siblings, 0 replies; 5+ messages in thread
From: David Heidelberg @ 2021-08-09 16:44 UTC (permalink / raw)
To: Arnd Bergmann, Russell King (Oracle)
Cc: Jon Medhurst, Ard Biesheuvel, Marc Zyngier, Nicolas Pitre,
Linux Kernel Mailing List, Linux ARM
Thank you, in next iteration I'll keep you as author and keep your S-off-by
-------- Původní zpráva --------
Odesílatel: Arnd Bergmann <arnd@arndb.de>
Odesláno: 9. srpna 2021 16:02:36 UTC
Komu: "Russell King (Oracle)" <linux@armlinux.org.uk>
Kopie: David Heidelberg <david@ixit.cz>, Arnd Bergmann <arnd@arndb.de>, Jon Medhurst <tixy@linaro.org>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, Marc Zyngier <marc.zyngier@arm.com>, Nicolas Pitre <nico@linaro.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux ARM <linux-arm-kernel@lists.infradead.org>
Předmět: Re: [PATCH] ARM: atags_to_fdt: don't warn about stack size
On Mon, Aug 9, 2021 at 5:24 PM Russell King (Oracle)
<linux@armlinux.org.uk> wrote:
> On Mon, Aug 09, 2021 at 05:10:21PM +0200, David Heidelberg wrote:
> > Signed-off-by: David Heidelberg <david@ixit.cz>
Acked-by: Arnd Bergmann <arnd@arndb.de>
(or keep my original Signed-off-by if you like)
> I assume Arnd never sent his v3 from what I see in the thread you link
> to above.
Yes, it's in my ever-growing backlog of things I plan to eventually resubmit.
In this case, I actually have a different patch in my tree, but that in turn
depends on other stuff I have to submit first (reorganizing the way that
warning options get handled based on compiler version etc), and the
version here is what works on current mainline kernels.
Arnd
S pozdravem a přáním krásného dne
David Heidelberg
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-09 16:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 15:10 [PATCH] ARM: atags_to_fdt: don't warn about stack size David Heidelberg
2021-08-09 15:24 ` Russell King (Oracle)
2021-08-09 16:02 ` Arnd Bergmann
2021-08-09 16:44 ` David Heidelberg
2021-08-09 15:25 ` Nicolas Pitre
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).