From patchwork Wed Dec 30 15:26: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: 59088 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2910654lbb; Wed, 30 Dec 2015 07:29:12 -0800 (PST) X-Received: by 10.66.100.163 with SMTP id ez3mr94738251pab.5.1451489352216; Wed, 30 Dec 2015 07:29:12 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id u68si18610043pfi.21.2015.12.30.07.29.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Dec 2015 07:29:12 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org 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 1aEIev-0000Qo-4D; Wed, 30 Dec 2015 15:27:29 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aEIeD-00008f-KC for linux-arm-kernel@lists.infradead.org; Wed, 30 Dec 2015 15:26:46 +0000 Received: by mail-wm0-x22e.google.com with SMTP id f206so40389383wmf.0 for ; Wed, 30 Dec 2015 07:26:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+wP/AZ5//dxmR+GIUusi3uVMqarXh+xDgCcdFOzvJ+Y=; b=TkQaKuWHQL6MKC6XhrEx6eh/vOhy8kZUhFlNP1MQOkZVWpiizyZgq+ws4Cy7E6PPFu 6JomA1YXdllltubcryBKB/2rEErFiNSLvaa695t+h2YRYrjo05X2ul2A0yny/Z5bxnQb snJH49XXkdij6pvrtXxw7NM2/K3OoR6XJ85kY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+wP/AZ5//dxmR+GIUusi3uVMqarXh+xDgCcdFOzvJ+Y=; b=Ds+vi+C1OKu2NTDISICpb8qFfqsStkUZHyASi0867d0I2qY94Qe41L5WVra+YSAvth ADJoNI6wTIn5g9gU/ZQU14wGP3n0qh7I9+5Hdm5lf3ZXCMSfuCAj0/Rg/CTR0Dxqaagf WUk3bucxz9aUeadfzv2AgxDpFdYSKrZM5Mrfbd3MSvrRDbzdy0m1sE/xAmdVqQc94wF9 3jl4UuSzdMbonRCfuGJbR0ubEtBny3eWas1NiaqIlh6enRpU4C9+GgTOMlmvrm2AWqye 9UCmTE1bcnomGwGxxIq3jNFAXgGo/b9YWhV9b2hzOVGBH/GRTrYZ0hMH9LuE3VhRujwt cCWQ== X-Gm-Message-State: ALoCoQmgmQvhZC4glXqL7h0yWaStPHxo3C1W+TtGq3sjuxomT9iw15P6tg8oWPvcPdRy9/EF+4gUT4LrJjZ+V6vT066ujXu8og== X-Received: by 10.28.182.135 with SMTP id g129mr59188695wmf.55.1451489185774; Wed, 30 Dec 2015 07:26:25 -0800 (PST) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by smtp.gmail.com with ESMTPSA id z137sm31510865wmc.8.2015.12.30.07.26.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Dec 2015 07:26:25 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com, will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, leif.lindholm@linaro.org, keescook@chromium.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/13] arm64: use more granular reservations for static page table allocations Date: Wed, 30 Dec 2015 16:26:02 +0100 Message-Id: <1451489172-17420-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1451489172-17420-1-git-send-email-ard.biesheuvel@linaro.org> References: <1451489172-17420-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151230_072645_817248_440A37AD X-CRM114-Status: GOOD ( 12.23 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: arnd@arndb.de, Ard Biesheuvel , bhupesh.sharma@freescale.com, stuart.yoder@freescale.com, marc.zyngier@arm.com, christoffer.dall@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 6bacba847923..8e678d05ad84 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -165,11 +166,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();