From patchwork Wed Dec 30 15:26:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 59089 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2910677lbb; Wed, 30 Dec 2015 07:29:15 -0800 (PST) X-Received: by 10.66.141.142 with SMTP id ro14mr92938163pab.112.1451489355443; Wed, 30 Dec 2015 07:29:15 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id w22si24597890pfi.253.2015.12.30.07.29.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Dec 2015 07:29:15 -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 1aEIel-0000Of-AZ; Wed, 30 Dec 2015 15:27:19 +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 1aEIeC-00007P-7G for linux-arm-kernel@lists.infradead.org; Wed, 30 Dec 2015 15:26:45 +0000 Received: by mail-wm0-x22c.google.com with SMTP id b14so52910744wmb.1 for ; Wed, 30 Dec 2015 07:26:23 -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=yr2fPCMdxIql1QsZNcumGYRdJ6RZe0IcEVSm7ScqOOo=; b=TfPg3K2P1fGr1KwwcRPYm03xVdcCUU2JHbBfJUG9oGtskLF9+T8Ep7EbSMn9SishRA dZt8a7SR3yk5mtSDGhtLAFi12abpk+pVE1BrScm66u0Yxp7t7rWWxsYaveWm/QokqZx2 rZAXyPku2JAPy4zOBbnjjDOzROUPdJeB4DogQ= 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=yr2fPCMdxIql1QsZNcumGYRdJ6RZe0IcEVSm7ScqOOo=; b=NEMSUCA+8ZSULsCrGULQ305e5hRS1UvVJrleboruKWDrvevX5PNfEZ0q+kiORbSfNn D+dFm7wGpKfqyBlv5+tkfsS3O3zmSFbWZdcHotckfL7oGxxAsE6MnQn6XE8zbu5a7kmC MXnjIAaLcucSR1v9zIoIhpInfUCeJvzLulwMDCo8g/HXYc6u06gXWGD7O9ZOgQb1esP5 CeNsVFuFSw0/LGbzT6tJKzGFngqQrlLJJvbQja7EQf4YzmdfP3FYfMlrqoQTcopV9atv +2BsnWbZDY3uykEVCE7Z97CBCAsVHEVrBuFYyEuvASgDKVw/JKxQ0WTo37XHZ1eAKb3M j/dg== X-Gm-Message-State: ALoCoQlI1DVPeEzgoA1ZwFm+k0evhZfWxfe5j7AsJsB6cHqGRJUh2qfo8SVJGfVHH9THgjaNKdxGwwIRslsS3zsVAsKsb7Nqcg== X-Received: by 10.28.54.159 with SMTP id y31mr60132911wmh.87.1451489181818; Wed, 30 Dec 2015 07:26:21 -0800 (PST) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by smtp.gmail.com with ESMTPSA id z137sm31510865wmc.8.2015.12.30.07.26.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Dec 2015 07:26:21 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com, will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, leif.lindholm@linaro.org, keescook@chromium.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/13] of/fdt: make memblock minimum physical address arch configurable Date: Wed, 30 Dec 2015 16:26:00 +0100 Message-Id: <1451489172-17420-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1451489172-17420-1-git-send-email-ard.biesheuvel@linaro.org> References: <1451489172-17420-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151230_072644_491049_599246A8 X-CRM114-Status: GOOD ( 12.17 ) 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: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_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: arnd@arndb.de, Ard Biesheuvel , bhupesh.sharma@freescale.com, stuart.yoder@freescale.com, marc.zyngier@arm.com, christoffer.dall@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org By default, early_init_dt_add_memory_arch() ignores memory below the base of the kernel image since it won't be addressable via the linear mapping. However, this is not appropriate anymore once we decouple the kernel text mapping from the linear mapping, so archs may want to drop the low limit entirely. So allow the minimum to be overridden by setting MIN_MEMBLOCK_ADDR. Acked-by: Mark Rutland Acked-by: Rob Herring Signed-off-by: Ard Biesheuvel --- drivers/of/fdt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 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/drivers/of/fdt.c b/drivers/of/fdt.c index d2430298a309..0455564f8cbc 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -971,13 +971,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, } #ifdef CONFIG_HAVE_MEMBLOCK +#ifndef MIN_MEMBLOCK_ADDR +#define MIN_MEMBLOCK_ADDR __pa(PAGE_OFFSET) +#endif #ifndef MAX_MEMBLOCK_ADDR #define MAX_MEMBLOCK_ADDR ((phys_addr_t)~0) #endif void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) { - const u64 phys_offset = __pa(PAGE_OFFSET); + const u64 phys_offset = MIN_MEMBLOCK_ADDR; if (!PAGE_ALIGNED(base)) { if (size < PAGE_SIZE - (base & ~PAGE_MASK)) {