From patchwork Wed Sep 23 00:37:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 54015 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 433C522D91 for ; Wed, 23 Sep 2015 00:41:14 +0000 (UTC) Received: by lagj9 with SMTP id j9sf15165563lag.0 for ; Tue, 22 Sep 2015 17:41:13 -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:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=foJ4Dsp2n90c8PfAJxJxf9TgxEmcX+iaMuo0Y1JkVus=; b=fWQOgQts//ZT71AkewhZ7dXKZ5fRmVD2TEjaKbHwwBQJQVbbVI/J0dm4FmK5t3ZPV7 zLfhSg6a84hJyDhyYftAmh+bY7CZ44lyePjKm1kPI0GosL1kghvDld3gAmaj1ASQSfaw WaIE1i6QbykP7AtxMYNNKHlyycFSLOexCweKKXqV9pDjJJ90IOHpkVSR/QaQDBV0EdBp knAJCEuBY0Z7YIwIK+tQaf6wojmxHSftU7vRgyR+JdCPHl6wZ1G78suufLnnJeiiR/0F fcJ1F95i6hW2wr0h6oMeNELh9rhKQUOyfw1eySsDqkwnU+Z3W4PSa1ZeDPfIyRiR/yCM ilHA== X-Gm-Message-State: ALoCoQnzEjyw3dcOWh568alU9l1E2IrxjfJ0ed4D1uzstxcspzQUCb+lQ/aHU6cz1w/ICSF/TUKN X-Received: by 10.180.105.98 with SMTP id gl2mr97385wib.0.1442968873077; Tue, 22 Sep 2015 17:41:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.230 with SMTP id e6ls14277lah.66.gmail; Tue, 22 Sep 2015 17:41:12 -0700 (PDT) X-Received: by 10.152.23.4 with SMTP id i4mr10531028laf.60.1442968872794; Tue, 22 Sep 2015 17:41:12 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id v80si1599803lfd.80.2015.09.22.17.41.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2015 17:41:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lahg1 with SMTP id g1so32892244lah.1 for ; Tue, 22 Sep 2015 17:41:12 -0700 (PDT) X-Received: by 10.152.5.133 with SMTP id s5mr10603872las.19.1442968872682; Tue, 22 Sep 2015 17:41:12 -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.59.35 with SMTP id w3csp789766lbq; Tue, 22 Sep 2015 17:41:11 -0700 (PDT) X-Received: by 10.66.216.1 with SMTP id om1mr34107232pac.51.1442968869752; Tue, 22 Sep 2015 17:41:09 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id w7si6368895pbs.85.2015.09.22.17.41.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2015 17:41:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) 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 1ZeY5e-0005hl-SR; Wed, 23 Sep 2015 00:39:18 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeY5J-0005QC-Ah for linux-arm-kernel@lists.infradead.org; Wed, 23 Sep 2015 00:38:57 +0000 Received: by pacex6 with SMTP id ex6so23808715pac.0 for ; Tue, 22 Sep 2015 17:38:36 -0700 (PDT) X-Received: by 10.66.142.202 with SMTP id ry10mr34912807pab.86.1442968716211; Tue, 22 Sep 2015 17:38:36 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id ja4sm1927162pbb.19.2015.09.22.17.38.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Sep 2015 17:38:35 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, will.deacon@arm.com, catalin.marinas@arm.com Subject: [PATCH v2 2/7] arm64: use more granular reservations for static page table allocations Date: Tue, 22 Sep 2015 17:37:38 -0700 Message-Id: <1442968663-31843-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442968663-31843-1-git-send-email-ard.biesheuvel@linaro.org> References: <1442968663-31843-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150922_173857_423655_5D9F809E X-CRM114-Status: GOOD ( 13.36 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.42 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: Ard Biesheuvel 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.43 as permitted sender) smtp.mailfrom=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 f5c0680d17d9..b9390eb1e29f 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -164,11 +165,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); early_init_fdt_scan_reserved_mem();