From patchwork Mon Jun 1 14:27:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11582107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A60B913 for ; Mon, 1 Jun 2020 14:28:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC8FA2068D for ; Mon, 1 Jun 2020 14:28:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="or8FQQ0C"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="qyaGQUdk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC8FA2068D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mbZftSyzSCszjd44R9CmqQKvZM/AcjEzcOGAmCKcZA4=; b=or8FQQ0C8YFZRC hn0wIw4M7rxUW3Vg14SQuVz0XViCu/ZsI/lwMQ9D+VA7uUpXvCs8YGIcOT5QVbZYnJxmTM8DaHs8Y uObUyWd5Vb2rJEP1CoBpQpyoKUsN7wsmxHKOhR6Vf9MT534GeEHxJOim04DOOHxaS4dARJq5s9cU+ btY6J65nvN/IpYvhmZ7Qp22S4l3MN8R9g3nY/mNICU40QwGsEBeElNHgKukqhKGQ/UafU4RpOPzBM p+4oHpjEG6OT6f+3+wmI3plu3yf8sZxvIPuCKjzdVL7iiV6yaG2PFJIeO5zEfxezDnEqKF1l3hVow WdrVSxBDauKgnqQeVyhw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jflQL-0003VH-Jr; Mon, 01 Jun 2020 14:28:21 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jflQC-0003Mu-Gw for linux-arm-kernel@lists.infradead.org; Mon, 01 Jun 2020 14:28:13 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200601142811euoutp0205bc52797551134f9227760f146e8bee~UccxjaqWZ2486424864euoutp02j for ; Mon, 1 Jun 2020 14:28:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200601142811euoutp0205bc52797551134f9227760f146e8bee~UccxjaqWZ2486424864euoutp02j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1591021691; bh=TcvRBVgibYuWvdnj8aP2i39hNoNN9xtEvOA0UIuLnMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qyaGQUdke+Ls9OJ+3s8sFwH+lw+wAfO0CCXNDuxpcsYibSVTGJ8Dq5BdidR56YU43 AKS0Udw1/lAF452Dj/BQkYQYrGudgBbecCAeD+A7gbQMYVGE11ee2HSejhNQignxvz Csz1jNvk5GsuLuO8WqWOzYwF6VMJKrkh7fksrba0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200601142810eucas1p2e42f5919d8046616d8e3dc2637fde2ed~UccxCsaUb0506105061eucas1p28; Mon, 1 Jun 2020 14:28:10 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 0D.EA.61286.A7015DE5; Mon, 1 Jun 2020 15:28:10 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200601142810eucas1p1767585cf172d26aedb551d7453aa7402~UccwvQZhL2462024620eucas1p1p; Mon, 1 Jun 2020 14:28:10 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200601142810eusmtrp1867c63cae3b0bc092ca73d4ff0bf8430~Uccwubcw43017330173eusmtrp1i; Mon, 1 Jun 2020 14:28:10 +0000 (GMT) X-AuditID: cbfec7f2-f0bff7000001ef66-bc-5ed5107a92d4 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 51.FB.07950.97015DE5; Mon, 1 Jun 2020 15:28:10 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200601142809eusmtip107d07cf168a890f2adfbbed52e457391~UccwgUcus1630616306eusmtip1J; Mon, 1 Jun 2020 14:28:09 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Russell King , 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 Subject: [PATCH 1/5] arm: decompressor: set malloc pool size for the decompressor Date: Mon, 1 Jun 2020 16:27:50 +0200 Message-Id: <20200601142754.26139-2-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601142754.26139-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTURzHObt31ztt67oif75lFTFLTSq5oEZG0f3T6L+g2cyLWW7a5kwt dCWozcwX9lAJKSNbljp1lRrKsKyW8/0YKmYF9kAZ85GaWs5r5H/f7/d8fuec7+GQmHiE70HG KZNYlVIeLyGccePbxa6ANGpAtr9jcgddd7eGTxc9b+PR1mvNPPpjroK2mqoQbfgyyKf7msoJ 2lTyGtHP2sec6IlPw3z66eoHRNsK/vDo5dZFnK43lGBHREzfYA/GlGl7cGZF/w1jKgwaxqC/ QTCjgy0EM22xODH1lRlMgW2KYG416BEzY/CJdDntHBbDxscls6qgw2edzw9oK/HEVWHKU2su rkUNLjpEkkAdhILGdB1yJsVUFYL2rlcYZ2YR2CpGEGdmENh/lWD/JsasAi5/jMAyuMLXIcGa mUQwZ4h0aIKKgPxH7/gOaDs1x4OmkmzCYTCqH8FEq5HnoLZRp+B+3kvCoXFqN7xq/LieC6lQ qNf+Rg4NlC9kP36xzgioMGgz2zcYV3h/7yvu0Fspf6i+PrSusTU+s7FsvQNQeSRk9tiduI2O Qa9tmeD0NvjR0bCRe4G5+CbOVcuA4qIQbvYmAmP5As4xoTBqWSIcDEZJoaYpiIsjYKpigseN imB4ypW7ggiKjHc2HksIOVlijt4Fz/NbNjb0gLwfVagASUo3lSndVKD0/1kVCNMjN1ajVsSy 6mAlezlQLVeoNcrYwHMJCgNa+3Lm1Q77SzTXG21CFIkkW4S14/0yMV+erE5VmBCQmGS78Gin WSYWxshT01hVQpRKE8+qTciTxCVuwgMPvp8RU7HyJPYiyyayqn+rPFLgoUVPvKTNfeE+pVEX c+vYwuGkEzZdrXK4s3k22nPee+e0/86lGf2Q+4uczBap/o9V5t19xe9n9ed4Nr2rfShcmxI4 3nF7Yc+ytLdTJJtuq1QI3aPCHr6ZW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eucas1p1767585cf172d26aedb551d7453aa7402 X-Msg-Generator: CA X-RootMTR: 20200601142810eucas1p1767585cf172d26aedb551d7453aa7402 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200601142810eucas1p1767585cf172d26aedb551d7453aa7402 References: <20200601142754.26139-1-l.stelmach@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200601_072812_693266_F489108A X-CRM114-Status: GOOD ( 13.85 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [210.118.77.12 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: AKASHI Takahiro , Marek Szyprowski , =?utf-8?q?=C5=81ukasz_Stelmach?= , Bartlomiej Zolnierkiewicz Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 #else /* * With ZBOOT_ROM the bss/stack is non relocatable, @@ -623,7 +624,8 @@ not_relocated: mov r0, #0 */ mov r0, r4 mov r1, sp @ malloc space above stack - add r2, sp, #0x10000 @ 64k max + ldr r2, =_malloc_size @ 64k max + add r2, r2, sp mov r3, r7 bl decompress_kernel