From patchwork Tue Feb 20 21:59:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128975 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp5104560ljc; Tue, 20 Feb 2018 14:00:43 -0800 (PST) X-Google-Smtp-Source: AH8x2267Ampl1HRhdwH3iuP/8SIMizUADU8QUWzTGt6+11jAsIixIONDGvc7x9yrtufzBQK/ipdZ X-Received: by 10.99.146.68 with SMTP id s4mr820259pgn.295.1519164042891; Tue, 20 Feb 2018 14:00:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519164042; cv=none; d=google.com; s=arc-20160816; b=gwk2mADe2NBNi2u/seX5E1087la9QYQTikwqQ20A0ne/rJ9F+VRZ2yZ84sJsYzN8Ov /kWUsjpjzJf4p92WpHw3R7SYljBbrWbottFARSyE+jyeFpt9dRyg/BzZfP0HdyM3BD+0 vW8PQDjcPMzmjOzcnHAOnrreXo/QMaX74eOZWsNBZNd3IpvxwLmNR6uy0gq1mZ2GVsOR FaI2WnF6WFLeCQozulj2mYcYRGtcjJfA3ETqE0k2tttUXnGI1382otQZyQF0aqKXkZbK u4xiX/C8/c17V6Krwsuzaf/rnsv+lszifzYS9YLfFjWp+FoDo0W0411uyPyOM+yxfO/s topw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Wgm/WyWxaoGNNudDRkcIBmuYYdB21rpK+DX1rRVLe64=; b=uMbcGYfVQEayqFPPO8GOOmxSQzGfrOigMjXu1JAo8feCmdpWz/Z4mORCkEcPcM2cYH q7nOEAvNFfSMr1o4FwXFIOJvZuRqWB3ZPzTLaukTtQeLYnt/0j10p8xNzX4cm8DgHyLY oZcSMPrQIgt/+Yq6sMrXBwRhz5+5AH8ZfZcHZFBB+v8c842eLS0AFDAGhHem4ENqWtkT psCbYV4P/8e0Ie6uuHQrgPryfxTAELW8+cwlULWduKXYUQY9ReYedcDi+iDOu/gNqBaK UFpFxU5tIXcVyDBKNFlJ1bycrlTEdkxIjYV0MpvbiiNLu+eX6vAKd+gA/J1dR+nWrVNI nj9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19si339645pgv.195.2018.02.20.14.00.42; Tue, 20 Feb 2018 14:00:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbeBTWAi (ORCPT + 28 others); Tue, 20 Feb 2018 17:00:38 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:54489 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbeBTWAX (ORCPT ); Tue, 20 Feb 2018 17:00:23 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M580s-1eYDOj16eU-00zHpr; Tue, 20 Feb 2018 22:59:59 +0100 From: Arnd Bergmann To: Nicolas Pitre Cc: Andi Kleen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 5/7] ARM: fix __inflate_kernel_data stack warning for LTO Date: Tue, 20 Feb 2018 22:59:52 +0100 Message-Id: <20180220215954.4092811-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180220215954.4092811-1-arnd@arndb.de> References: <20180220215954.4092811-1-arnd@arndb.de> X-Provags-ID: V03:K0:j6Z6mLTdh/+X4G+YKxS3ATVR3daU4zabNyhWk408l8/5Z67spBE n0pCT5KxKMZP6OlGOXCaY4YuZzd5g3HbUizruyCE50CaCAsxfBFR9jVQ4Eu2LQsolfPl3G4 q3lDsZjZcv6hmaVQ7MDfjV1cRrs+BKjiSgFpfI70u5wuuA7+ZFfD31tcTE5lxsh/AJs95E6 TVpmCU33xqIXuheIpHF2w== X-UI-Out-Filterresults: notjunk:1; V01:K0:4WRBaSnnQvU=:Rj3TLw5/GN9ssMjC4jMoO+ iJAgM4VFA9XC0WrCQzLMPzyCikr01S4ZHDiLzLhvAJtk7YgoBk2PT9lxQJman5mdq5/af5tGn 3ql21rvSJJ0xC3ANc92k4Lqr9s08WU5lVyaQZLwKz+ASlmtfsDL1h3NPAoKdYD2WWfmlonC8+ QUPWpbFZDHp1HJKKZVrrQ8oO8+UgrgFsJWwoUcglUVxBV0PhB5vcXtWUJhAIZtA9vJDVOJQ9t Wf7h40IIfXWSoG3NKg5r7JISuRX+0ByIt0unvE8VBsAqVORyYxP8/LYsHc61g35LTEd/YKxkv 4T+m5/p+pEBe5MzwHI3L6YxeDp7KaNkAUDhMgVGc4sAzAKu+gGvU2egPBwTVUp3cl5Gcq3yaM y+DaSTZF5gH9DyFXB4Bv8+fa04aUPN9ydwfRkEIWL5O/itpPcpuCOdqmxcoNxgW1u2jXsmTwP ovpKnXAQJgWSoDJwEHt+5c4XLriKEI6StcFm8HWHnFpdB0iMZBJvHotp5Yjk+pZkIGu46zuG2 qLtNx7IVmUiLhJQOYTivJSTrbcJ0VZ4Z9eXgrG+XV5VAeIky8nkr1Y4/2LRLevJVrl0jHgC1c ZhAYFCbzVYWbeDIRwK2bLgaWjLpkUJZ3HiO3A1fbiP9opg6mmCvJ98gEKzGnEFxjmDiRLvWjO LQu1/b6NGv7fRPNWRypRDVfEkuOuFHC4V7b17fsaRAafjZEJJOQXscsGdhP2HHIS9sfpKvMVD uICgi2PPEX47Gk4KJAbG4ClxS+ylAqiRs/0vIKiGQK037s+SKZPSMj3zqtTgnEE2B8yk/54XM HriashmaS2qdVjIahAci/6kBIDH95HMogzKRiB8hwSCkovlhaporkLeFgISLQvt0+ZO5ZFQWa gecCpyUtrUkN5HTIRhPXmEkv1O3/XalFke0PxR7ZHM3Xsbw3QI/qQW8frYnauG Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/arm/kernel/Makefile | 3 --- arch/arm/kernel/head-inflate-data.c | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) -- 2.9.0 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;