From patchwork Tue Feb 2 17:56:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 61037 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp884778lbb; Tue, 2 Feb 2016 09:58:29 -0800 (PST) X-Received: by 10.66.155.167 with SMTP id vx7mr49216467pab.109.1454435908041; Tue, 02 Feb 2016 09:58:28 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id y22si3192228pfi.57.2016.02.02.09.58.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Feb 2016 09:58:28 -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 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 1aQfCn-0005pU-J3; Tue, 02 Feb 2016 17:57:33 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQfCU-0005j7-Fj for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2016 17:57:15 +0000 Received: by mail-wm0-x22a.google.com with SMTP id l66so128831420wml.0 for ; Tue, 02 Feb 2016 09:56:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kYNogocOueOQsP58xEVJLJnp2oGo9wJH6VD+Uc5fVxw=; b=BssbQgahizQMRaR8Q1X1wTMFJRR+r3+qZFCZelBFZNSQbaxmn9kUbr2hdpbahjRY/j ugWofb5mqOxf4R/7vikHY7xN13MqXO+M0JeMKy1UJMUb3gh0NeOz57e51plmgWyu68cb GX+BuPXcvMQ+TJhwjGLwp22JOm+ZwAyxeboCY= 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=kYNogocOueOQsP58xEVJLJnp2oGo9wJH6VD+Uc5fVxw=; b=cFrfW6x1Be2jZyQBdzntTYvfbUmwbikNGW8i5ukhX03Kj3nJxiz5tDO+0+rli9aUDc TgZYMxQxDRd2xwdfDc9WJZHqltjbyQdVpyKtX26+CNmB2M4pATTEBNfrFZCjHCgtfOTO AcJfLydYl6gpqSfcVOBPTnyrOWHz2w/vG1pNaWgftxvgUmmgj/TE7fyYsXTj3+2pNGxb cb2PoBiy0IeFEB+MmTB9kPG/W+EF2ZGmy9VLnkgleGydTlBnh72vOTGhYvuU9SuIDSge JbG2aUhV3QjmHnRbsbulg3OI5jTkSJohp4uqyYpTGgTiaYm9ZT+OWv6I489h24isrZGY i+aw== X-Gm-Message-State: AG10YOQOUfQBTjQpqDsmTLP6O22/ut6Ug/JUPMoijvZHnKTbyAZWgTxAIxRcCYPju4U6nO7R X-Received: by 10.194.240.66 with SMTP id vy2mr30105769wjc.28.1454435812925; Tue, 02 Feb 2016 09:56:52 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id z127sm17556513wme.2.2016.02.02.09.56.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Feb 2016 09:56:52 -0800 (PST) From: Ard Biesheuvel To: msalter@redhat.com, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 2/3] arm64: add the initrd region to the linear mapping explicitly Date: Tue, 2 Feb 2016 18:56:41 +0100 Message-Id: <1454435802-7604-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454435802-7604-1-git-send-email-ard.biesheuvel@linaro.org> References: <1454435802-7604-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160202_095714_743193_F55FDCA3 X-CRM114-Status: GOOD ( 13.62 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 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:22a 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_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Instead of going out of our way to relocate the initrd if it turns out to occupy memory that is not covered by the linear mapping, just add the initrd to the linear mapping. This puts the burden on the bootloader to pass initrd= and mem= options that are mutually consistent. Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/init.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 2.5.0 _______________________________________________ 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/mm/init.c b/arch/arm64/mm/init.c index f3b061e67bfe..5dd083161810 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -167,8 +167,20 @@ void __init arm64_memblock_init(void) */ memblock_reserve(__pa(_text), _end - _text); #ifdef CONFIG_BLK_DEV_INITRD - if (initrd_start) - memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start); + if (initrd_start) { + u64 base = __virt_to_phys(initrd_start); + u64 size = initrd_end - initrd_start; + + /* + * The initrd needs to be accessible via the linear mapping. So + * add the memory covered by the initrd explicitly, since it may + * have been clipped or otherwise left out when we traversed the + * DT memory nodes or the UEFI memory map. + */ + memblock_add(base, size); + memblock_clear_nomap(base, size); + memblock_reserve(base, size); + } #endif early_init_fdt_scan_reserved_mem();