public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Nicolas Pitre <nico@linaro.org>
Cc: Andi Kleen <ak@linux.intel.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 5/7] ARM: fix __inflate_kernel_data stack warning for LTO
Date: Tue, 20 Feb 2018 22:59:52 +0100	[thread overview]
Message-ID: <20180220215954.4092811-6-arnd@arndb.de> (raw)
In-Reply-To: <20180220215954.4092811-1-arnd@arndb.de>

Commit ca8b5d97d6bf ("ARM: XIP kernel: store .data compressed in ROM")
moved the decompressor workspace to the stack and added a compiler
flag to avoid the stack size warning.

With LTO, that warning comes back. Moving the workspace into an initdata
variable avoids that warning but presumably also undoes the optimization.

We could also try disabling the warning locally in that file with
_Pragma("GCC disagnostic"), but we lack a little bit of infrastructure
to do that nicely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/kernel/Makefile            | 3 ---
 arch/arm/kernel/head-inflate-data.c | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index b59ac4bf82b8..2e8d40d442a2 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -88,9 +88,6 @@ head-y			:= head$(MMUEXT).o
 obj-$(CONFIG_DEBUG_LL)	+= debug.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
-# This is executed very early using a temporary stack when no memory allocator
-# nor global data is available. Everything has to be allocated on the stack.
-CFLAGS_head-inflate-data.o := $(call cc-option,-Wframe-larger-than=10240)
 obj-$(CONFIG_XIP_DEFLATED_DATA) += head-inflate-data.o
 
 obj-$(CONFIG_ARM_VIRT_EXT)	+= hyp-stub.o
diff --git a/arch/arm/kernel/head-inflate-data.c b/arch/arm/kernel/head-inflate-data.c
index 6dd0ce5e6058..b208c4541bd1 100644
--- a/arch/arm/kernel/head-inflate-data.c
+++ b/arch/arm/kernel/head-inflate-data.c
@@ -35,10 +35,11 @@ extern char _sdata[];
  * stack then there is no need to clean up before returning.
  */
 
+static __initdata struct inflate_state state;
+
 int __init __inflate_kernel_data(void)
 {
 	struct z_stream_s stream, *strm = &stream;
-	struct inflate_state state;
 	char *in = __data_loc;
 	int rc;
 
-- 
2.9.0

  parent reply	other threads:[~2018-02-20 22:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 21:59 [PATCH 0/7] ARM: hacks for link-time optimization Arnd Bergmann
2018-02-20 21:59 ` [PATCH 1/7] ARM: disallow combining XIP and LTO Arnd Bergmann
2018-02-21  3:01   ` Nicolas Pitre
2018-02-21 11:50     ` Arnd Bergmann
2018-02-21 15:13       ` Nicolas Pitre
2018-03-12  2:40   ` Nicolas Pitre
2018-03-12 13:52     ` Arnd Bergmann
2018-03-12 16:46       ` Arnd Bergmann
2018-03-12 17:00         ` Nicolas Pitre
2018-03-12 17:05           ` Nicolas Pitre
2018-03-12 17:07           ` Arnd Bergmann
2018-02-20 21:59 ` [PATCH 2/7] ARM: LTO: avoid THUMB2_KERNEL+LTO Arnd Bergmann
2018-02-21  3:12   ` Nicolas Pitre
2018-02-21 11:48     ` Arnd Bergmann
2018-03-07 18:30   ` Matthias Kaehlcke
2018-03-07 18:52     ` Nicolas Pitre
2018-02-20 21:59 ` [PATCH 3/7] [HACK] pass endianess flag to LTO linker Arnd Bergmann
2018-02-21  3:15   ` Nicolas Pitre
2018-02-21  9:44     ` Arnd Bergmann
2018-02-21  8:37   ` Ard Biesheuvel
2018-02-21  9:48     ` Arnd Bergmann
2018-02-21 10:09       ` Ard Biesheuvel
2018-02-21 13:00         ` Arnd Bergmann
2018-02-20 21:59 ` [PATCH 4/7] ARM: io-acorn: fix LTO linking without CONFIG_PRINTK Arnd Bergmann
2018-02-20 21:59 ` Arnd Bergmann [this message]
2018-02-21  3:26   ` [PATCH 5/7] ARM: fix __inflate_kernel_data stack warning for LTO Nicolas Pitre
2018-02-20 21:59 ` [PATCH 6/7] ARM: mark assembler-referenced symbols as __visible Arnd Bergmann
2018-02-20 21:59 ` [PATCH 7/7] efi: disable LTO for EFI stub Arnd Bergmann
2018-12-17 22:50 ` [PATCH 0/7] ARM: hacks for link-time optimization Peter Zijlstra
2018-12-18  0:08   ` Andi Kleen
2018-12-18  9:18     ` Peter Zijlstra
2018-12-18 10:00       ` Peter Zijlstra
2018-12-21 14:23         ` Paul E. McKenney
2018-12-21 17:20       ` Andi Kleen
2018-12-21 18:00         ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180220215954.4092811-6-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=ak@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nico@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox