From patchwork Mon Nov 16 18:32:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 56673 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1481798lbb; Mon, 16 Nov 2015 10:35:39 -0800 (PST) X-Received: by 10.68.165.131 with SMTP id yy3mr12015649pbb.163.1447698939316; Mon, 16 Nov 2015 10:35:39 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kn1si52131634pbc.209.2015.11.16.10.35.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2015 10:35:39 -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 1ZyObR-0008JV-Dp; Mon, 16 Nov 2015 18:34:09 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyOaY-0007QF-Qe for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2015 18:33:16 +0000 Received: by wmww144 with SMTP id w144so122749139wmw.1 for ; Mon, 16 Nov 2015 10:32:53 -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=RD/FESMbW+GNY9aDfHJyDXe0zOBp6hrKs7olI+cDsHE=; b=b9XEtKKuerWNeBdlqK+VwDlAl8ZtOw1HLt91ZDKWuk+vqtcnpWnUsna4r2Qe7yyQbV o3RVorPz7QP4wM8ciPI6aepLAHMBSoKlPTN7N0oK5rn2sZ6QEUu351b3ppickzTdz4C2 So2ygHtGpO1Nfti5YxfhCYPMTwYLnA2V32z9bZSAYcmb7zPudNdEzYqySjchZaWQp0R2 gdUTUZmz7prZ879ci7INjcmHMhLq5DfAFv1LkLZ4oQr+L0vBBqHSF6l18OUQiD17kTLZ 96Yvj7EoSiUZRWVCmuJopqUb+SZgqfWZbIpeb/kJ/BUMt3qf8CYtNA0AHVr5dCL23+oq ZHtA== 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=RD/FESMbW+GNY9aDfHJyDXe0zOBp6hrKs7olI+cDsHE=; b=mqhhgkVKswpilSAJjxacSUQQrOPr1jGa+yyhIrdv8A7DvuCaJXXBlD3YHL8XTYgIwn MAk/AFfPksPlQX1SxOVnYSqylomvUyZ0xmkatY48+u6iGoqG2aS8qhapcXs/XXeoIkHQ zGEPbf6DGTw7g8i5iYZN4qnwtqSZQpz7oxqfNFrK/qTEvXTJ40mHsSoUuA+mFBd8j/cF anVvGQRrqSKawblXJCQXVQFHczO5gPSeOrZIwtLi1jGHUJzyg+5Ob8KsdEt/C90pr/0K QjAuRoxxitbMoSPG76TZ9bXl/PT2AzwIvTUX+Q+DrZC9wan00E+z/tpAqswRQInP/NpE ToPw== X-Gm-Message-State: ALoCoQlvEdSDuVvos7FTWtqTZYrRphjgv/334QTiS/9PQo1sVrOc72tBrh5h6N6toN4/VLRtHsit X-Received: by 10.28.63.204 with SMTP id m195mr19118377wma.11.1447698773170; Mon, 16 Nov 2015 10:32:53 -0800 (PST) Received: from ards-macbook-pro.lan (2-237-3-18.ip236.fastwebnet.it. [2.237.3.18]) by smtp.gmail.com with ESMTPSA id he3sm35796779wjc.48.2015.11.16.10.32.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Nov 2015 10:32:52 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, matt.fleming@intel.com, linux@arm.linux.org.uk, will.deacon@arm.com, grant.likely@linaro.org, catalin.marinas@arm.com, mark.rutland@arm.com, leif.lindholm@linaro.org, roy.franz@linaro.org Subject: [PATCH v2 03/12] arm64/efi: mark UEFI reserved regions as MEMBLOCK_NOMAP Date: Mon, 16 Nov 2015 19:32:28 +0100 Message-Id: <1447698757-8762-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447698757-8762-1-git-send-email-ard.biesheuvel@linaro.org> References: <1447698757-8762-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151116_103315_419931_36545C52 X-CRM114-Status: GOOD ( 11.70 ) 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:232 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: linux-mm@kvack.org, ryan.harkin@linaro.org, Ard Biesheuvel , akpm@linux-foundation.org, msalter@redhat.com 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 de46b50f4cdf..c7c7fb417110 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -183,7 +183,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("*"); } @@ -205,8 +205,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); memmap.map_end = memmap.map + params.mmap_size; @@ -218,6 +216,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)