From patchwork Mon May 11 07:13:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48211 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2CDE32121F for ; Mon, 11 May 2015 07:16:42 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf36238761lbb.0 for ; Mon, 11 May 2015 00:16:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=fv/BxL1zonBtLI1zI60sg7mrDQtd/S1/13cQ+BDN2K8=; b=GeLrSLy7WCL84PCamKSRaXsilo8Mm4xXK+xEMJ64XYVscAfcPp1j6NS7ZJZ6lnnGSq R8zrUQh3Q7XywUxEzrWbjPMFZE26w0Ytb9WQpOdonw1nWVCaxVbSsdMeyfjlbYrj482X SBJNqjYPR78ocdGZl/yBDUyckW1lbO9emMS9TmbvnWPR6ZZ0BvatlT8Lhpy9+/DVA0Qt zsOXVKwfJ3mC78MucF8wZvN4t+3YITnDbr4lCN4NDU9g9x0sk0Rq8k9U1tdiwq3/7mwS 0QfyVbMr/85VIk4wFm12HVPKRC4OIOILGsx279LdybnzU1l20ETxffm5Iqi0EouVY0MO dAYQ== X-Gm-Message-State: ALoCoQn1OZuWLo+xr1wwe3yBzN8cvmF4zjFN3hEfoKrm5wTXE9H+8+iz9kniDM5C8Y6X2lgT1ANH X-Received: by 10.112.55.104 with SMTP id r8mr6683385lbp.18.1431328601111; Mon, 11 May 2015 00:16:41 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.131 with SMTP id s3ls549310las.65.gmail; Mon, 11 May 2015 00:16:40 -0700 (PDT) X-Received: by 10.112.13.233 with SMTP id k9mr7118944lbc.57.1431328600972; Mon, 11 May 2015 00:16:40 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id rt1si7856256lbb.121.2015.05.11.00.16.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:16:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labbd9 with SMTP id bd9so87034125lab.2 for ; Mon, 11 May 2015 00:16:40 -0700 (PDT) X-Received: by 10.152.27.98 with SMTP id s2mr7093219lag.106.1431328600872; Mon, 11 May 2015 00:16:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1345926lbb; Mon, 11 May 2015 00:16:39 -0700 (PDT) X-Received: by 10.66.63.106 with SMTP id f10mr16886782pas.0.1431328599157; Mon, 11 May 2015 00:16:39 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id i4si16821987pbq.65.2015.05.11.00.16.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:16:39 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YrhvT-0001M1-FI; Mon, 11 May 2015 07:14:55 +0000 Received: from mail-wg0-f45.google.com ([74.125.82.45]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YrhuJ-0000jB-9Z for linux-arm-kernel@lists.infradead.org; Mon, 11 May 2015 07:13:44 +0000 Received: by wgiu9 with SMTP id u9so119064136wgi.3 for ; Mon, 11 May 2015 00:13:21 -0700 (PDT) X-Received: by 10.194.192.226 with SMTP id hj2mr17872778wjc.51.1431328401241; Mon, 11 May 2015 00:13:21 -0700 (PDT) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id o5sm10728933wia.0.2015.05.11.00.13.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 00:13:20 -0700 (PDT) From: Ard Biesheuvel To: catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/10] arm64: use more granular reservations for static page table allocations Date: Mon, 11 May 2015 09:13:02 +0200 Message-Id: <1431328388-3051-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431328388-3051-1-git-send-email-ard.biesheuvel@linaro.org> References: <1431328388-3051-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150511_001343_524328_5D961260 X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.125.82.45 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.45 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Before introducing new statically allocated page tables and increasing their alignment in subsequent patches, update the reservation logic so that only pages that are in actual use end up as reserved with memblock. Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index a3469a436a73..373ea02bdb96 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -173,11 +174,13 @@ void __init arm64_memblock_init(void) * Register the kernel text, kernel data, initrd, and initial * pagetables with memblock. */ - memblock_reserve(__pa(_text), _end - _text); + memblock_reserve(__pa(_text), __bss_stop - _text); #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); #endif + memblock_reserve(__pa(idmap_pg_dir), IDMAP_DIR_SIZE); + memblock_reserve(__pa(swapper_pg_dir), SWAPPER_DIR_SIZE); if (!efi_enabled(EFI_MEMMAP)) early_init_fdt_scan_reserved_mem();