Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp534378ybg; Mon, 1 Jun 2020 07:49:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyEzt+hYBFhRq8E4+tFc9eb3yI8f22c2xKSbmfAiI1bkimdmu7Xm1qdZBRk/DCck6QzoDI X-Received: by 2002:a17:906:4406:: with SMTP id x6mr19527183ejo.160.1591022948546; Mon, 01 Jun 2020 07:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591022948; cv=none; d=google.com; s=arc-20160816; b=BLHg6qt6if0e5Ii0I5bkDxole8EAo8SK3QIvMAs3uZUDtCxyLyMrDK1kRi1f/7IG2i RiqsGON4gXAI3BDhdJtElVgsifVGVazW5f6fDC84YI5gg6+JriWqm9cPxSpPyMJjHlS3 0lqi0PVJpcMF1TcdTU9OaFHr0MqNBs8O7ykTE7PCDkbyhcUxtaFitWbDjRryi8YNQQAR wA+t9VvPCU05JnLMhRQvJZXXbORsl8M98J9aAvV3DU8ogHal8yAIdYfTLLGsCdWblY7o n2XdF1M3x4Ba812hXaaS6mOPXPhYEX6qjDqy0xzK4eIbt8FeE5FyKBpbNGRuRbViFVSC N3dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/UgT1POWifvMyJNciOhK8kmfi25RCwYtZsLhUmUhAxQ=; b=Hi4tu3StKfSqGYXV3xioDOfkFcN0QgjSCMxoh0wxG4R+4YATipHK1ErWF11pi2EE7X db28qo1FDahxsNt70Y3wBYtlSZqVu2QsYPC+Z/DsoJ+oH92D3VChYFmrKfLHZDaoZO9G co2f7VpR0uRc9KD0KOtICru1Gk2+mWU/P8a41WfmpXqrRaL6R6AnFlKAattPF1VuhpqX m3/YagVRGcJmT1WpPinGFwxS3So3AyQbAeCHUwBMGYA9l1O5rsETPLq7HthSmVac0suS ab5f3//xjg/GoRPskTKwHwlw0eTar/kj/0hl1fEkGCwoKDfitkEctnyktvG+ugXLUDyF NIcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=xfXwxQLI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn16si12947026ejc.427.2020.06.01.07.48.45; Mon, 01 Jun 2020 07:49:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=xfXwxQLI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727807AbgFAOqo (ORCPT + 99 others); Mon, 1 Jun 2020 10:46:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbgFAOql (ORCPT ); Mon, 1 Jun 2020 10:46:41 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 894A8C03E96F for ; Mon, 1 Jun 2020 07:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/UgT1POWifvMyJNciOhK8kmfi25RCwYtZsLhUmUhAxQ=; b=xfXwxQLIKqe6CYTZE8B3XMFjT QohrjTCJ9iVED68MI64wBiPdRxYlTOwCytLQ8bepIUXyuRNrYkqX2DZWNbtNEjUtszhFapIgAFKwX pcPL2C4PE9aS+E+XomPiBu1qbqAZRwZKbCzQhDwWqanV3+cFnxwndmRQM7Y968XzBxm2uiIXlI9SA xixTqchLnibodP/P4pinLpT3OlouW8wjfGN2pqWsjOr2iuXTvIgIuhvkjWdkTUaHmBGlJ0dJGlLRZ LblReP9VAmUhB7URVY0uK49wtuU9shUTPSsTI8LtzA+RBdUW4Jy0jM0qlUNL7t5WzoiCfBiNP16g1 yU57jiSxA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:39982) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jflhl-0000XW-Bb; Mon, 01 Jun 2020 15:46:21 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jflhX-0003OW-Sb; Mon, 01 Jun 2020 15:46:07 +0100 Date: Mon, 1 Jun 2020 15:46:07 +0100 From: Russell King - ARM Linux admin To: =?utf-8?Q?=C5=81ukasz?= Stelmach Cc: Masahiro Yamada , Nick Desaulniers , Thomas Gleixner , Enrico Weigelt , Kees Cook , Ingo Molnar , Ben Dooks , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: Re: [PATCH 1/5] arm: decompressor: set malloc pool size for the decompressor Message-ID: <20200601144607.GI1551@shell.armlinux.org.uk> References: <20200601142754.26139-1-l.stelmach@samsung.com> <20200601142754.26139-2-l.stelmach@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200601142754.26139-2-l.stelmach@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 01, 2020 at 04:27:50PM +0200, Łukasz Stelmach wrote: > Move the definition of malloc pool size of the decompressor to > a single place. This value will be exposed later for kexec_file loader. > > Signed-off-by: Łukasz Stelmach > --- > arch/arm/boot/compressed/Makefile | 2 ++ > arch/arm/boot/compressed/head.S | 6 ++++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > index 9c11e7490292..b3594cd1588c 100644 > --- a/arch/arm/boot/compressed/Makefile > +++ b/arch/arm/boot/compressed/Makefile > @@ -125,6 +125,8 @@ KBSS_SZ = $(shell echo $$(($$($(NM) $(obj)/../../../../vmlinux | \ > sed -n -e 's/^\([^ ]*\) [AB] __bss_start$$/-0x\1/p' \ > -e 's/^\([^ ]*\) [AB] __bss_stop$$/+0x\1/p') )) ) > LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) > +# malloc pool size > +LDFLAGS_vmlinux += --defsym _malloc_size=0x10000 > # Supply ZRELADDR to the decompressor via a linker symbol. > ifneq ($(CONFIG_AUTO_ZRELADDR),y) > LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR) > diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S > index e8e1c866e413..dcc1afa60fb9 100644 > --- a/arch/arm/boot/compressed/head.S > +++ b/arch/arm/boot/compressed/head.S > @@ -309,7 +309,8 @@ restart: adr r0, LC0 > #ifndef CONFIG_ZBOOT_ROM > /* malloc space is above the relocated stack (64k max) */ > add sp, sp, r0 > - add r10, sp, #0x10000 > + ldr r10, =_malloc_size > + add r10, r10, sp This says "locate _malloc_size in a literal pool somewhere, and load it using a PC-relative offset". Are you sure that the literal pool is sensibly located? Would it be better to use a definition for this? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC for 0.8m (est. 1762m) line in suburbia: sync at 13.1Mbps down 424kbps up