From patchwork Wed Apr 15 15:34:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 47205 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E639E2121F for ; Wed, 15 Apr 2015 15:39:55 +0000 (UTC) Received: by lamp14 with SMTP id p14sf11069333lam.3 for ; Wed, 15 Apr 2015 08:39:54 -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=IWw6zav/KjIx6ATNQp+77R/K0a+0yX1CvoEXOfFtdIY=; b=A27V45vBHZW5UKqjDwVOEqdNdBaLr+7ou38gj5Gvo8wHZSRvUDCmGYk3tzkxklL6ly VGca/ca8oYCqINFzbJ05gaBoSTZFW7DicSj8eyphKLQF9rQY9j/vRsWXD8xovInItVbV g/AL2gglChNyCmh7k5/St99zsURkpP+rNLkN2ZOgH/OuAgc0wkLw7Azgp8NmAeaGxeHS VN3Zv/OgO6djIDJG8N1RBTUH1CkL8y843o5/yP8Af1sn3MLfkwz9QRXBWATHdXfwNgJE HVRVnagXR+gw/UKK/BTxLPhln6vwyIPyBrE93JB/ijP7QX4oxKl6P55otwRunCSayKpt s7gQ== X-Gm-Message-State: ALoCoQlieQF2+Rs1t+cSBgeAnMujqg61M17axvK7XNCS3Wd7hOq4i1AmkGoyhwIY6FkmAPApRKLY X-Received: by 10.194.95.67 with SMTP id di3mr5618245wjb.0.1429112394887; Wed, 15 Apr 2015 08:39:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.35 with SMTP id cr3ls174661lad.47.gmail; Wed, 15 Apr 2015 08:39:54 -0700 (PDT) X-Received: by 10.112.160.165 with SMTP id xl5mr24537295lbb.109.1429112394578; Wed, 15 Apr 2015 08:39:54 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id o12si4181255lal.67.2015.04.15.08.39.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 08:39:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcga7 with SMTP id ga7so37230984lbc.1 for ; Wed, 15 Apr 2015 08:39:54 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr24317944lac.36.1429112394489; Wed, 15 Apr 2015 08:39:54 -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.67.65 with SMTP id l1csp2592855lbt; Wed, 15 Apr 2015 08:39:53 -0700 (PDT) X-Received: by 10.66.66.43 with SMTP id c11mr47204155pat.20.1429112391761; Wed, 15 Apr 2015 08:39:51 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id td9si7553106pac.213.2015.04.15.08.39.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 08:39:51 -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 1YiPNi-0001y1-5d; Wed, 15 Apr 2015 15:37:38 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YiPM8-0000yR-OA for linux-arm-kernel@lists.infradead.org; Wed, 15 Apr 2015 15:36:01 +0000 Received: by wgyo15 with SMTP id o15so51282058wgy.2 for ; Wed, 15 Apr 2015 08:35:39 -0700 (PDT) X-Received: by 10.194.248.132 with SMTP id ym4mr4571985wjc.74.1429112139156; Wed, 15 Apr 2015 08:35:39 -0700 (PDT) Received: from ards-macbook-pro.local ([90.174.5.175]) by mx.google.com with ESMTPSA id eh5sm7674765wic.20.2015.04.15.08.35.28 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Apr 2015 08:35:38 -0700 (PDT) From: Ard Biesheuvel To: mark.rutland@arm.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 07/13] arm64: use more granular reservations for static page table allocations Date: Wed, 15 Apr 2015 17:34:18 +0200 Message-Id: <1429112064-19952-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1429112064-19952-1-git-send-email-ard.biesheuvel@linaro.org> References: <1429112064-19952-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150415_083600_989793_7468A9AA X-CRM114-Status: UNSURE ( 9.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.49 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] -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.217.180 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 1599a5c5e94a..0e7d9a2aad39 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); early_init_fdt_scan_reserved_mem();