From patchwork Mon Jan 11 13:18:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 59478 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2105193lbb; Mon, 11 Jan 2016 05:21:25 -0800 (PST) X-Received: by 10.98.1.203 with SMTP id 194mr26574128pfb.10.1452518485395; Mon, 11 Jan 2016 05:21:25 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id eg4si40265622pac.40.2016.01.11.05.21.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jan 2016 05:21:25 -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 1aIcOK-0003HB-Ft; Mon, 11 Jan 2016 13:20:12 +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 1aIcO7-0002iM-BB for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2016 13:20:00 +0000 Received: by mail-wm0-x229.google.com with SMTP id f206so268019126wmf.0 for ; Mon, 11 Jan 2016 05:19:39 -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=Tgeq697LeLo5VGJJOYUeXOkTbhiF1haDx8DwW//xTHeVv8Hm69AmwZO6Qn+XrB1slL +25lalR0j/rHL+BFXOgbME+Oj1Ag/ii89nReXB2BIL8POBJBrkPZRdAwoNiqaoUMTauN cyV11a/Ymo37JAgcBncS2saTVBG92OE/Bxchs= 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=WwN1UhCmSgb4XaGZ/wAo5ZDyZkJxwfl/adu+tUvcWRMBbKnR97sxcVimRRNp4AvmPa BBeRjxzOcdkHjBN2uztbGniy2PAY5/bEVl8DIuVkxdS1RU4n/se3C2Xk+2+VVsYaLBDj DnB4SlboR6/3sJsFVyA4OaGqp7h8GTrtctPEVxM8Re6ZWzzFCLiF0xJ9QpToEjdQ+WQ9 npk2GAdfh66AjVUemdznD+AKM+l+aBqrTAnSVIIeEUrKNJldVy6XGBC8EUrfbz31EBCN +9bAkJ0Lvqz0Mkm49UGPM+skXiqmhBv6zNVJBOwF/N8+2GJ7+D/tnterFoAd0IlaMQ8o EZDQ== X-Gm-Message-State: ALoCoQlVQtf3rib6JDj59oMo1neDycdRsASmjgf59yxt1jgjruWN++rPU637ZV++qn8zECKOlfCFSlg/z6eTeIjSFDjD6gSsZQ== X-Received: by 10.194.2.243 with SMTP id 19mr5165544wjx.154.1452518377868; Mon, 11 Jan 2016 05:19:37 -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 c15sm12766055wmd.19.2016.01.11.05.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 05:19:36 -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 v3 01/21] of/fdt: make memblock minimum physical address arch configurable Date: Mon, 11 Jan 2016 14:18:54 +0100 Message-Id: <1452518355-4606-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452518355-4606-1-git-send-email-ard.biesheuvel@linaro.org> References: <1452518355-4606-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160111_051959_601969_9F51E964 X-CRM114-Status: GOOD ( 11.72 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.0 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_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)) {