From patchwork Mon Nov 30 12:28:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 57443 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1439152lbb; Mon, 30 Nov 2015 04:36:31 -0800 (PST) X-Received: by 10.66.252.129 with SMTP id zs1mr90529700pac.59.1448886991726; Mon, 30 Nov 2015 04:36:31 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 10si3509362pfb.206.2015.11.30.04.36.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2015 04:36:31 -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 1a3NfR-0001Oj-El; Mon, 30 Nov 2015 12:34:53 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3NaL-0004FH-Vi for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2015 12:29:48 +0000 Received: by wmec201 with SMTP id c201so135828370wme.1 for ; Mon, 30 Nov 2015 04:29:16 -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=jInvoDqRuZUSbi5wMyDvGGdCWI1caRRkkzE/ADehEJY=; b=dfN878TXWFNRrywZ3Bhg+qZBFY8Oih+m1cenvVZeG2b7pdCdE9eKHr9sFo85DCOulp Jt/2P7K4ugS42G52dsCkveuPB4Z3E6j4Zhs1LEI/HI06fgIeQEAsnS3PYDHmVUpEIiaO SEZqwydvAk+1eZPC/R4sOwaykX6jOJZLUifsIEhKx79ASB2wpdnW86dNeHRZkK+gMrF3 hj/i08YqlO7PdX99vVyEQzyxi5XEoNOMgZUA9Zvvf+oozHQWIVKrr8yPrcT3f2uOee7W iJI2x9NaZUGQUUsT7fA8az57cB+Q3N0WmHetindgbv0b1f+/jSEHlXx8GZWWBUzQ61j7 5q6g== 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=jInvoDqRuZUSbi5wMyDvGGdCWI1caRRkkzE/ADehEJY=; b=msrSycE60Ugkr/rRqJbwa0rEqz/U6bDqBwIltxHsstbNqaNLw6u0eleRDzYIcYzt20 6O+GSEAQJGYjbI9InxAAz4cijmcwyHdlfWVO56BvV34dJIVr2oMFA0WYXrewTyBpcjeQ gyYYbKdZGwKG06rpfd3iTr36tJMhYIVzFKSqMftNofoDSRUG2jDLCRLgWsz4UZGC78MQ UbLvOZZ5QsifVjeacuY98goDcdV4Pbuki3S0hGR7LW5uLsKnpea9y8Jtpwx1swqatfCU 4RXCBOmKIEniRo3II0HSnMbM2keZcBWtCiCijV8OchZcLIiRJAbtBMdrCTF2jcadVjbD 0rCA== X-Gm-Message-State: ALoCoQnn+DuwEG9VViXnhvNU4WoK3LK8w4UYeJMDce6I4OJYnQTKR4nEIfp6ZLclovi0VHMgwCbC X-Received: by 10.194.110.5 with SMTP id hw5mr84586924wjb.154.1448886556241; Mon, 30 Nov 2015 04:29:16 -0800 (PST) Received: from localhost.localdomain (host2-115-static.225-95-b.business.telecomitalia.it. [95.225.115.2]) by smtp.gmail.com with ESMTPSA id d2sm46560361wjy.16.2015.11.30.04.29.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Nov 2015 04:29:15 -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, linux@arm.linux.org.uk Subject: [PATCH v4 03/13] arm64/efi: mark UEFI reserved regions as MEMBLOCK_NOMAP Date: Mon, 30 Nov 2015 13:28:17 +0100 Message-Id: <1448886507-3216-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448886507-3216-1-git-send-email-ard.biesheuvel@linaro.org> References: <1448886507-3216-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151130_042938_642253_0122026C X-CRM114-Status: GOOD ( 11.64 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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. Reviewed-by: Matt Fleming 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 4eeb17198cfa..04531d35f1df 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)