From patchwork Mon Dec 28 11:20:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 59010 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1647315lbb; Mon, 28 Dec 2015 03:23:26 -0800 (PST) X-Received: by 10.98.2.78 with SMTP id 75mr45411059pfc.14.1451301806079; Mon, 28 Dec 2015 03:23:26 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id g17si17797029pfg.98.2015.12.28.03.23.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Dec 2015 03:23:26 -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 1aDVsk-0003Aw-OL; Mon, 28 Dec 2015 11:22:30 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDVri-0002ib-3M for linux-arm-kernel@lists.infradead.org; Mon, 28 Dec 2015 11:21:26 +0000 Received: by mail-wm0-x232.google.com with SMTP id f206so4363860wmf.0 for ; Mon, 28 Dec 2015 03:21:05 -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=S2n1QIO9wqnXh+qfLzW52RDyJ5Ng4NpduRPpZbnbB0RH22jeILNH1kbgxG9j5CExlg tNZT7AVHzIyGuvCv1pZuCfTk8n7V5dXDPIxukq2eobUQh5bn0fVno3+M8NQaOh5Vi+Aa y6Onh+i5YvYNoIVruYRt3tLQMv9rw1aep3HjQ= 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=T5vRxSfYQEb63vaGgq5KZptkchUwPZROCrgee/c1ZflcOUKsm1Lc6wFpPGGCtevZ9f 9W1Acb3mHtL7A7285+cA4fmsfocAg1/bT3XXOMkqJbg4bTZPf5JI2kCFluBO4bIggeKb mkUoZZQiIx2I8GJ+hYItory8EjxEWKA0J3J4cQ4H85Jg9pVIzVEbjuQwsz4GLRu9UpbY Rcl4v3tOisaYGkG2gCBYmq6QIJKVirhQgoS1HPObHwvLc4gF1bLsJuWThhrH6V31b9Z4 XYG3Zd73/zIoracVAj+JjBmfUVGtZV3IHbqYbv5E8VX77WWCGYccASyYgfstdogro8Pb /sBw== X-Gm-Message-State: ALoCoQlsa1QNkeyxd1DhlqEiS8d1OMrflJqiytRKUs5zN7YbdfH81aGoRq2OEHsbeeHvLciGXXD373QQfNSTuHsW/53+XzFVgg== X-Received: by 10.28.48.194 with SMTP id w185mr61405430wmw.73.1451301664579; Mon, 28 Dec 2015 03:21:04 -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 i63sm22556235wmf.24.2015.12.28.03.21.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Dec 2015 03:21:03 -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, lkml@vger.kernel.org Subject: [RFC PATCH 02/10] arm64: use more granular reservations for static page table allocations Date: Mon, 28 Dec 2015 12:20:46 +0100 Message-Id: <1451301654-32019-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1451301654-32019-1-git-send-email-ard.biesheuvel@linaro.org> References: <1451301654-32019-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151228_032126_299864_30B1153E X-CRM114-Status: GOOD ( 11.56 ) 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:232 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: bhupesh.sharma@freescale.com, stuart.yoder@freescale.com, Ard Biesheuvel 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();