From patchwork Mon May 11 07:12:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48208 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A2B92121F for ; Mon, 11 May 2015 07:15:48 +0000 (UTC) Received: by wiun10 with SMTP id n10sf23237334wiu.1 for ; Mon, 11 May 2015 00:15:47 -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=ZTxPaffzoG4W9DxGGAr+8o5CoyJN9tmvMhOfCfgEX6g=; b=M74iyNtj3PCw/1UXk4Wc9Awjtrcpj6tOe4BJwd9+ds+hBj5AjXNGYp5i9P0uY0VExz m4PeVzoSYMM7AK6oqsSAvzCi/1jGy1AVRjD2W6bUMoSfQLf19em1sl+LfPvdCbcZ6tPu Aoxp/6QusR3ixFvrd2BXjJjU5Dg7AElpWnUmXMLh3HGr0uAfIZplWqcC685i0AuEVw6J /re85IERqOB0GqVbqNBbsqu4rr6nJTTdUfQKivqABCs1kfCeCp3xI53rWw2WcgWGEHJS UNlhh+ppcPHa6WU61Ms4OmQz5DSvqhUkPxPW4LA9bspDWsPsiEZVpDRIVc/xFgL5XjXA HIsA== X-Gm-Message-State: ALoCoQnE2NZq2WJTXF6wKcfoQusWHlhFRrCe/5uM1vxCqubod2VFdvNDUkjrD+eywEZzKUlX6uLi X-Received: by 10.112.171.41 with SMTP id ar9mr6629715lbc.24.1431328547050; Mon, 11 May 2015 00:15:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.208 with SMTP id k16ls615890lab.42.gmail; Mon, 11 May 2015 00:15:46 -0700 (PDT) X-Received: by 10.152.42.164 with SMTP id p4mr6610239lal.3.1431328546904; Mon, 11 May 2015 00:15:46 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id p10si7861775lap.75.2015.05.11.00.15.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:15:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbcga7 with SMTP id ga7so87683165lbc.1 for ; Mon, 11 May 2015 00:15:46 -0700 (PDT) X-Received: by 10.113.10.134 with SMTP id ea6mr6956979lbd.29.1431328546769; Mon, 11 May 2015 00:15:46 -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 hn6csp1345580lbb; Mon, 11 May 2015 00:15:45 -0700 (PDT) X-Received: by 10.66.165.67 with SMTP id yw3mr16831858pab.95.1431328544941; Mon, 11 May 2015 00:15:44 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ze1si16853249pac.95.2015.05.11.00.15.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:15:44 -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 1Yrhub-0000tT-FS; Mon, 11 May 2015 07:14:01 +0000 Received: from mail-wi0-f175.google.com ([209.85.212.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YrhuE-0000iM-U5 for linux-arm-kernel@lists.infradead.org; Mon, 11 May 2015 07:13:39 +0000 Received: by wizk4 with SMTP id k4so93523236wiz.1 for ; Mon, 11 May 2015 00:13:16 -0700 (PDT) X-Received: by 10.180.75.197 with SMTP id e5mr16626836wiw.94.1431328396402; Mon, 11 May 2015 00:13:16 -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.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 00:13:15 -0700 (PDT) From: Ard Biesheuvel To: catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 01/10] arm64/efi: use dynamically allocated space for EFI pgd Date: Mon, 11 May 2015 09:12:59 +0200 Message-Id: <1431328388-3051-2-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_001339_188024_8EE66876 X-CRM114-Status: GOOD ( 11.82 ) 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.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.175 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.175 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.217.178 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 Now that we populate the EFI page tables during an initcall, we can allocate the root pgd dynamically instead of statically in .bss. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 5369b4f96dd1..f3ba25621f7a 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -32,17 +32,15 @@ #include #include #include +#include #include struct efi_memory_map memmap; static u64 efi_system_table; -static pgd_t efi_pgd[PTRS_PER_PGD] __page_aligned_bss; - static struct mm_struct efi_mm = { .mm_rb = RB_ROOT, - .pgd = efi_pgd, .mm_users = ATOMIC_INIT(2), .mm_count = ATOMIC_INIT(1), .mmap_sem = __RWSEM_INITIALIZER(efi_mm.mmap_sem), @@ -227,6 +225,10 @@ static bool __init efi_virtmap_init(void) { efi_memory_desc_t *md; + efi_mm.pgd = pgd_alloc(&efi_mm); + if (!efi_mm.pgd) + return false; + for_each_efi_memory_desc(&memmap, md) { u64 paddr, npages, size; pgprot_t prot; @@ -313,7 +315,7 @@ static int __init arm64_enable_runtime_services(void) return 0; } -early_initcall(arm64_enable_runtime_services); +postcore_initcall(arm64_enable_runtime_services); static int __init arm64_dmi_init(void) {