From patchwork Mon Sep 14 15:55:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 53594 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 7FE7E22B17 for ; Mon, 14 Sep 2015 15:57:36 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf43233240wic.2 for ; Mon, 14 Sep 2015 08:57:35 -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=EuWXnG1AvNw39+0ynNXRgRk2Fv2e1R3iw4ZRulNC4oE=; b=d3yTT+PVVxf8WjakDASIBSOBxdHnVS8I5FPNEnThrFn+u1cj5qsWWJwjswmmrM0E9z tED0/tcPo/xKGSOFDhhrRWSnpuc/8xesO9dMNMZUdtlYdG7ohYSsl/COfdo6hFcVqYh/ EYn3rJYJ+lsbvODCNi9iUGUVVlfCnruXMEIyAFanKxUXtYQmet1wCAu6bAA4BFz7JIxB 2D1NgvD5yGtYS1TftRK9bIMKNKPfo47IgvOPQSaGjLEGqVY6lqCYEQUoZ4Bl8CduBVpL GU0f82gDr4LapZJCc9rRiM/n6dZkkjLJ+DFVBqp2H9iCy/UbIHgRJ4C7eMR950qinWJd Za2A== X-Gm-Message-State: ALoCoQlenZr4a7zpoXAg91srTnfOlvk/7UXzp0fhO/IIwZjntsBU/IVnk9xcKDt5zTMt/RItKAbF X-Received: by 10.112.48.41 with SMTP id i9mr3203690lbn.23.1442246255845; Mon, 14 Sep 2015 08:57:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.227 with SMTP id f3ls671799lag.81.gmail; Mon, 14 Sep 2015 08:57:35 -0700 (PDT) X-Received: by 10.152.28.100 with SMTP id a4mr15143276lah.46.1442246255692; Mon, 14 Sep 2015 08:57:35 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id lj3si9402409lab.155.2015.09.14.08.57.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 08:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbcao8 with SMTP id ao8so69844009lbc.3 for ; Mon, 14 Sep 2015 08:57:35 -0700 (PDT) X-Received: by 10.112.135.9 with SMTP id po9mr10026597lbb.56.1442246255496; Mon, 14 Sep 2015 08:57:35 -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 w3csp1276836lbq; Mon, 14 Sep 2015 08:57:34 -0700 (PDT) X-Received: by 10.68.111.65 with SMTP id ig1mr33987920pbb.130.1442246254308; Mon, 14 Sep 2015 08:57:34 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id x10si24342075pas.107.2015.09.14.08.57.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 08:57:34 -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 1ZbW7H-0003MK-6D; Mon, 14 Sep 2015 15:56:27 +0000 Received: from mail-wi0-f178.google.com ([209.85.212.178]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZbW6s-0002wA-Kg for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2015 15:56:03 +0000 Received: by wicfx3 with SMTP id fx3so146532246wic.1 for ; Mon, 14 Sep 2015 08:55:41 -0700 (PDT) X-Received: by 10.194.81.169 with SMTP id b9mr29798560wjy.3.1442246140975; Mon, 14 Sep 2015 08:55:40 -0700 (PDT) Received: from localhost.localdomain (AToulon-652-1-468-111.w86-211.abo.wanadoo.fr. [86.211.148.111]) by smtp.gmail.com with ESMTPSA id ry1sm16225999wjb.24.2015.09.14.08.55.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Sep 2015 08:55:40 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, catalin.marinas@arm.com, will.deacon@arm.com, leif.lindholm@linaro.org, mark.rutland@arm.com, msalter@redhat.com, akpm@linux-foundation.org Subject: [PATCH 3/3] arm64/efi: mark UEFI reserved regions as MEMBLOCK_NOMAP Date: Mon, 14 Sep 2015 17:55:29 +0200 Message-Id: <1442246129-13930-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442246129-13930-1-git-send-email-ard.biesheuvel@linaro.org> References: <1442246129-13930-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150914_085602_838154_62520177 X-CRM114-Status: GOOD ( 12.73 ) 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.212.178 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.212.178 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.217.177 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 Change the EFI memory reservation logic to use memblock_mark_nomap() rather than memblock_reserve() to mark UEFI reserved regions as occupied. In addition to reserving them against allocations done by memblock, this will also prevent them from being covered by the linear mapping. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index e8ca6eaedd02..f609325c4a83 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -193,7 +193,7 @@ static __init void reserve_regions(void) early_init_dt_add_memory_arch(paddr, size); if (is_reserve_region(md)) { - memblock_reserve(paddr, size); + memblock_mark_nomap(paddr, size); if (uefi_debug) pr_cont("*"); } @@ -215,8 +215,6 @@ void __init efi_init(void) efi_system_table = params.system_table; - memblock_reserve(params.mmap & PAGE_MASK, - PAGE_ALIGN(params.mmap_size + (params.mmap & ~PAGE_MASK))); memmap.phys_map = (void *)params.mmap; memmap.map = early_memremap(params.mmap, params.mmap_size); memmap.map_end = memmap.map + params.mmap_size; @@ -228,6 +226,7 @@ void __init efi_init(void) reserve_regions(); early_memunmap(memmap.map, params.mmap_size); + memblock_mark_nomap(params.mmap, params.mmap_size); } static bool __init efi_virtmap_init(void)