From patchwork Wed Feb 13 08:58:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 2134601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id EFAEE3FCA4 for ; Wed, 13 Feb 2013 09:01:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5YB2-0002VR-Mq; Wed, 13 Feb 2013 08:58:52 +0000 Received: from mail-ee0-f47.google.com ([74.125.83.47]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U5YB0-0002UA-51 for linux-arm-kernel@lists.infradead.org; Wed, 13 Feb 2013 08:58:50 +0000 Received: by mail-ee0-f47.google.com with SMTP id e52so463479eek.34 for ; Wed, 13 Feb 2013 00:58:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:x-mailer :x-gm-message-state; bh=bFsEjBOORZMUHlMJvWRDh/4UG1KEca7DxxcQHUWYtFA=; b=Im6SUqWUizhkxd0TMoLIeSL34MWD94YiSR5oiC4JCYq9uF96clfLAV2Tf58zkNRmRc 9NXKRBuZXcdTN7Ayz9+tf45BUZ3dGZQmI6cDi2YOd6CvEvgPEZWp2BINThaPKYzkSF0B Vu0wby1RY7mar6Rq9bEEIx13qwytmPL3edhqgMcFAvCfe0ihBZwh0VEMHiRvOWUGR4PP OIZDSMlWnzPXuhCcmYitY2C8z/p2D7Mg758m9hCsoe9+/8PeEku01s8l3rIaaqDyy4Gl UxqqZ57/e9VRzcRJTlD8W1VkuHAxvziBE+cdSlwyA1Gmi6NJIxmI8hVwBbuyuzMFIW3H tLlQ== X-Received: by 10.14.193.134 with SMTP id k6mr3517063een.37.1360745927779; Wed, 13 Feb 2013 00:58:47 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPS id q5sm71866550eep.11.2013.02.13.00.58.46 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 13 Feb 2013 00:58:46 -0800 (PST) From: Michal Simek To: linux-arm-kernel@lists.infradead.org, monstr@monstr.eu Subject: [PATCH 1/2] arm: mm: Ignore memory banks which are in front of the kernel when HIGHMEM is ON Date: Wed, 13 Feb 2013 09:58:44 +0100 Message-Id: <1360745925-20952-1-git-send-email-michal.simek@xilinx.com> X-Mailer: git-send-email 1.7.0.4 X-Gm-Message-State: ALoCoQmk/3QN2K/0yqvRltH9XdLO0m41E7yae8pVSfsUcEMBEW4EfP+j7mGHZjE00LWc+1AExKOL X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130213_035850_292154_A45774B8 X-CRM114-Status: GOOD ( 13.80 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.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 [74.125.83.47 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Arm kernel with HIGHMEM ON will fail when dts memory node is described by memory banks and the starting address is not inside the first 16MB of the first memory bank. If HIGHMEM is OFF and the configuration is the same then the first memory bank is ignored and the kernel boots. Here is the example of behavior: dts memory reg = <0x0 0x10000000 0x10000000 0x30000000> kernel load address = 0x10000000 (respectively 0x1000800) Current: "Machine: Xilinx Zynq Platform, model: Zynq ZC702 Development Board bootconsole [earlycon0] enabled Memory policy: ECC disabled, Data cache writeback Kernel panic - not syncing: ERROR: Failed to allocate 0x1000 bytes below 0x0." After: The kernel ignore ram 0x0-0x0fffffff because is lower than the kernel starting address and the kernel bootlog contains. "Ignoring RAM at 00000000-0fffffff (CONFIG_HIGHMEM)." Also using mem=768M on the command line will overwrite dts memory map and kernel will boot with HIGHMEM ON too. Signed-off-by: Michal Simek --- arch/arm/mm/mmu.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index ce328c7..e60f370 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -937,6 +937,15 @@ void __init sanity_check_meminfo(void) highmem = 1; #ifdef CONFIG_HIGHMEM + if (__va(bank->start + bank->size - 1) < (void *)PAGE_OFFSET) { + pr_notice("Ignoring RAM at %.8llx-%.8llx ", + (unsigned long long)bank->start, + (unsigned long long)bank->start + + bank->size - 1); + pr_cont("(CONFIG_HIGHMEM).\n"); + continue; + } + if (__va(bank->start) >= vmalloc_min || __va(bank->start) < (void *)PAGE_OFFSET) highmem = 1;