From patchwork Mon Nov 23 09:06:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 57116 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1315707lbb; Mon, 23 Nov 2015 01:09:13 -0800 (PST) X-Received: by 10.66.118.168 with SMTP id kn8mr1968979pab.122.1448269753428; Mon, 23 Nov 2015 01:09:13 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id yp1si18514405pbc.152.2015.11.23.01.09.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Nov 2015 01:09:13 -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.20150623.gappssmtp.com 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 1a0n6C-0003Z1-AN; Mon, 23 Nov 2015 09:07:48 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0n5k-0003Gq-O8 for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2015 09:07:22 +0000 Received: by wmww144 with SMTP id w144so95198016wmw.0 for ; Mon, 23 Nov 2015 01:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qPqXhWOSHN80D/PENYK6gRRHeMzEUdxzdDy8C/NzjLE=; b=vEq3szbx6wIlbzDpHSHD1Fx8Bdqn3HKCWl1Hn7JV5dNcrSmqsvzP7ifpQCv8lYFuMs 36Tv94L1BBcaJTEY+RpHQEn2k5s7yzxS2GfhFBtmu9J35QzlXrnsZrB4iw9Efy10I/MK hof+897bzF7gDa4qK3iUVnor+X6Bq7839MmetuXifL0mHw8zHWNKimkIzt5JJ9pml1Y5 R9tL5CL+YxFfGRGM/Jj3UoeooL3vSoHq/85JccHefQI39BJStvNSpbaxFcPF+uhS/yob C1PNoUCecCtwTGC+dDPub6pCn6R4LxbbxpkEESssSczMNpsc9MoXgTESHyOwRUHfrXQD b7Hg== 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=qPqXhWOSHN80D/PENYK6gRRHeMzEUdxzdDy8C/NzjLE=; b=JCI5H9nM9T0BpV1t6Ahq0VfuGfmYE8FYkuWewIz89DHiUofH4BbSQUjRTkrxyNsHSD wsPSjIY0oFHaZmCF71d8gzxyRPyvMXtR9CblFq8HUQZhy1fXZDgLZYHur0ESrSZPZc50 rsmFZ5QKejFGSUmcGDV38gNgKM3HWHZv/r8kpwdxuk5QY1J0MlkJ5IhKDUriwUvaHQJJ gHKv/EV0kOw7VaD6fg/t9+OpeX6hvjkE3//68ugITNWWCDkGg93OUZ9su6hN1xUzI+oy FpI/Q6z1ucVFybmxWfAtFALdj2j6/ySJBEj6eAb5NxamWYf/x8AkKI3ly5JGrQLy821G xOcA== X-Gm-Message-State: ALoCoQnnUBmwQdqSEBL7BlPHqlI7odmUPQH3tekG8nvnypchEuGFkI/ckXbdHsmN6rP5TNksVI5Y X-Received: by 10.194.5.2 with SMTP id o2mr31631554wjo.98.1448269619090; Mon, 23 Nov 2015 01:06:59 -0800 (PST) Received: from localhost.localdomain ([2.44.140.166]) by smtp.gmail.com with ESMTPSA id h189sm12241754wme.1.2015.11.23.01.06.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 01:06:58 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, linux-efi@vger.kernel.org, leif.lindholm@linaro.org, matt@codeblueprint.co.uk Subject: [PATCH v3 03/13] arm64/efi: mark UEFI reserved regions as MEMBLOCK_NOMAP Date: Mon, 23 Nov 2015 10:06:23 +0100 Message-Id: <1448269593-20758-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448269593-20758-1-git-send-email-ard.biesheuvel@linaro.org> References: <1448269593-20758-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151123_010721_095197_B4B9DF1D X-CRM114-Status: GOOD ( 12.03 ) 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 [2a00:1450:400c:c09:0:0:0:22c 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_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: kuleshovmail@gmail.com, Ard Biesheuvel , roy.franz@linaro.org, linux-mm@kvack.org, ryan.harkin@linaro.org, msalter@redhat.com, grant.likely@linaro.org, akpm@linux-foundation.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 1.9.1 _______________________________________________ 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/kernel/efi.c b/arch/arm64/kernel/efi.c index 3aeb576965c0..d746d15c882f 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -187,7 +187,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 (efi_enabled(EFI_DBG)) pr_cont("*"); } @@ -209,8 +209,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 = params.mmap; memmap.map = early_memremap(params.mmap, params.mmap_size); if (memmap.map == NULL) { @@ -230,6 +228,9 @@ void __init efi_init(void) reserve_regions(); early_memunmap(memmap.map, params.mmap_size); + memblock_mark_nomap(params.mmap & PAGE_MASK, + PAGE_ALIGN(params.mmap_size + + (params.mmap & ~PAGE_MASK))); } static bool __init efi_virtmap_init(void)