From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A03EDC10F13 for ; Thu, 11 Apr 2019 15:13:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6310C2083E for ; Thu, 11 Apr 2019 15:13:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="D4EJMsDa"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Qsd58eJZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6310C2083E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/zup/uehpyQ6rG1+37ZlI+wMAiExjf9e/ebNMS8+2k0=; b=D4EJMsDaLF0qR3 +d/7nL8tZLry9NHDtg9UjeH8owV38x/+hpMArr0PUX6vAI3ecoDA4CA768C3hDODIp7nlUGCMGa/k 1nd8YjdfxZdPWriomVqAZ9/N7foPHUU1FH5UcZSCVOvEmW/4ZuIKRnJIECPyTjYL/s/bivwt/WR49 gPBgSyXJySfwr2C4rdx0IXtpK38VQ24HU0kKct+Y0yhi29z+XVCcHQ5wKiFETjRMwoc+WKJBRfHPS c77aisOV/+o4rAOcL4JeIEEUOAxRkIYuQEbLCCZ72tstJHcz70wwfa9anjvFLgwQomFQFIAHskUZM ZOJSuVqD9ZE+sOBpN/Ow==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEbOK-0002Uw-Jg; Thu, 11 Apr 2019 15:13:28 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEbOH-0002UD-OB for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2019 15:13:27 +0000 Received: by mail-wr1-x42b.google.com with SMTP id j9so7871524wrn.6 for ; Thu, 11 Apr 2019 08:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=1Ke+yRtCXJkahmEYlQLnW1zbWS+S41qP8M8ZAGAZ6Mk=; b=Qsd58eJZSeYl1dSnj19hnK9xFhRqO303Kbujqgq1db2RmVFxKK+79gC+apCDSfm61Z X/8Nm/BOiQk2SvVkf+Lze/Rcf2j0oio8WvWrlFVQSUrarWyXPs+bablpBSnsVV2CSG2m Uz/zcgXIcgpyaQu9Hyw1Cos6Q+3fHvu9suGpI/vt0PxF66OdaoV6qXZfXB5tF56PkZm/ O624awTdu90fsSyGueHcI07Igq+0TC6uGt9IlzQgx72kmlWbFjGMAGgNqN5Uhuh+TwOe Ce7lvmCuVm7d0QfEONOEeBayUEtpT9ad3M/CFTmf2vXJjS3Ekmc49lhx6+mxcsXdOj6R vaAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=1Ke+yRtCXJkahmEYlQLnW1zbWS+S41qP8M8ZAGAZ6Mk=; b=t15u/AsgBw4DV+oq0F5MrofvkPHLYMnOhop6D/oRIMPg8ndjK4MvBbaxp9hKvSFmz/ 8CHjcGIE4tx0VIi6LLvYYfDXUwR0TNgVd5LljRO7ZJLI6AdmsldLl4lCVnd+Tx3pMNBQ PjyggNMeSYyryZ0yOIvrJzWnMqppdH6f0KrTU5XbQorTZ4x4+2m5Le+YrpPV7kn09ngb VS6abU0Cx/GO5hLxNtPS4s1Wg1r3mp9hio+0T1wybXThnavRlXtI0E6LRS9C9VRIqKhy V1TKyVeDl+g/FBlxoOA1tfDW1EAP6OM/IBOwBlAScn4v5g9k+7p/2UYpNTg2LC3LR2D5 +zBQ== X-Gm-Message-State: APjAAAXzLL7uPlw1a6hCc4WTChQQ0tse5WatzchUL5C7INbGmsJ8rS5g wy7GW8lZdbFzXi6OcuIOwytfIU5Fltg= X-Google-Smtp-Source: APXvYqxdsacWDlGHrBBxbk0yXvbCH/saYd7d7dI27NWfB3J9BT01r6JUDe+6ht9bjlxzmbwd23KBrA== X-Received: by 2002:adf:d848:: with SMTP id k8mr32536067wrl.185.1554995603559; Thu, 11 Apr 2019 08:13:23 -0700 (PDT) Received: from apalos (athedsl-165181.home.otenet.gr. [85.75.188.219]) by smtp.gmail.com with ESMTPSA id d4sm33382437wrv.42.2019.04.11.08.13.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 08:13:22 -0700 (PDT) Date: Thu, 11 Apr 2019 18:13:20 +0300 From: Ilias Apalodimas To: linux-arm-kernel@lists.infradead.org Subject: Memory size and section boundary on armv7 Message-ID: <20190411151320.GA23031@apalos> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190411_081325_815248_1761C25F X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, labbott@redhat.com, linux@armlinux.org.uk, mrutland@arm.com, ard.biesheuvel@linaro.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, While experimenting with u-boot and booting the kernel as an EFI stub i seem to hit an issue with memory mapping (map_lowmem). I can only reproduce the crash when using u-boot's dtb (specified in fdtcontroladdr) and pass that to the kernel, instead of loading an external one with 'dtb=' on it's command line. If CONFIG_ARM_LPAE=y, everything works fine. If the latter is not selected though the kernel seems to crash only if dtb is placed on a section boundary. The reason is crashes is the BUG_ON() on arm_pte_alloc() triggers. fdt size is 0xc00 in both scenarios. So something like this works fine: In this case ff000 + c000 + f5000 = 200000 [ 0.000000] MAP addr: c7c00000, next c7e00000, phys c7c00000 len 200000 [ 0.000000] INI addr: c7e00000, next c7eff000, len ff000 [ 0.000000] INI addr: c7f0b000, next c8000000, len f5000 [ 0.000000] MAP addr: c8000000, next c8200000, phys c8000000 len 200000 In this working case kernel maps sizes ff000 and f5000 alloc_init_pte() and skips the 0xc000 of the fdt correctly The non-working case is: [ 0.000000] MAP addr: c7e00000, next c7f00000, phys c7e00000 len 100000 [ 0.000000] INI addr: c7f0c000, next c8000000, len f4000 Both entries end up using the same pmd I am not sure what's the best way to fix that. Obviously skipping the alloc_init_pte() once this case is detected fixes things, but is there a better idea? Thanks /Ilias _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel