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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 7D8DEC433E1 for ; Sat, 15 Aug 2020 09:23:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 1C42A23105 for ; Sat, 15 Aug 2020 09:23:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ys/WgLMt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="qDwXQ1tD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C42A23105 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: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:List-Owner; bh=jJGK6kKZ5seDHg+xGO4YuaIff5ojwOdQlozGB/rDSQo=; b=Ys/WgLMt+cZqWsibhcLOAUl56 qgj7jRjSw0E5DR08tpr7AnhBLgDIos6YxkH7Gf7xzU7BqsC4qW26xfxfuYvhOLCLeeTjECeqhW8hv 0NEBIbMhEAMwRAKbJgd8J8p3w+sTlQg5SrwGbfer+nanLUkwnjjquVjTxnghKypZzSH5IFZqBF9eA G/NiXPWSr2QzOHPDbOJ0+N2XpXsZsbzsejG1mYJSRhpeMX+u8yA1xoYcu6IvZqMYe30d0nsVy7kV6 CSOiYfyaBPjKWTaeIcBshnamcTWHyL0JvdidoSsflxPX7v5Un/3LRAvWTHbUC/ThK5sBsnkzGKLvF Afv7LYSBg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6sNi-0005MG-DZ; Sat, 15 Aug 2020 09:21:42 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6sNg-0005DC-2d for linux-arm-kernel@lists.infradead.org; Sat, 15 Aug 2020 09:21:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YTXVAf7SxO6dJCxtIqDzrMtvbAtyylYrsY5KjL/bkkA=; b=qDwXQ1tDWb2kSCRZ7ylh8tLMf nuBoA7HInMtbzGolYEcKPgb/ze2UpqNmAZUIRGup/I5HUxL29a7YsdfU8eKmST2dP2HIR2obFd4of 3LibGiNsD4X/7TqrH+xPAsgQ+qRfD0LxlD7U4wePyczuornPWE/4YId7N6+2z2vUo9qCzZjLzHli+ dXWjmt7/BoJ54K1BKQaCJN0E7X2j/44Ii0k2K/BmpVodKRPKSy6TQSR7fcp71nL7IjcY+mePKBTC0 39F80EkQ1Hy9QooI2v8WzjDdCDIGIwwpWoaxJdyoB/UyQ5HGvKSjXzA0qM7I8P7J5l/xiv47IWx+1 QpF3wdYYg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:52760) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6sKa-0005E5-Dz; Sat, 15 Aug 2020 10:18:28 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1k6sKZ-0006hq-T6; Sat, 15 Aug 2020 10:18:27 +0100 Date: Sat, 15 Aug 2020 10:18:27 +0100 From: Russell King - ARM Linux admin To: Ard Biesheuvel Subject: Re: [PATCH/RFC v7] ARM: boot: Obtain start of physical memory from DTB Message-ID: <20200815091827.GW1551@shell.armlinux.org.uk> References: <20200706150205.22053-1-geert+renesas@glider.be> <159546718359.3847286.13460778905630969897@swboyd.mtv.corp.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200815_052140_170799_3A408A86 X-CRM114-Status: GOOD ( 30.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kumar Gala , Geert Uytterhoeven , Arnd Bergmann , Nicolas Pitre , Stephen Boyd , Linus Walleij , Lukasz Stelmach , Bjorn Andersson , Linux-Renesas , Chris Brandt , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Eric Miao , Dmitry Osipenko , Laura Abbott , Masahiro Yamada , Linux ARM , Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 14, 2020 at 04:06:03PM +0200, Ard Biesheuvel wrote: > On Fri, 14 Aug 2020 at 16:03, Linus Walleij wrote: > > > > On Thu, Jul 23, 2020 at 3:19 AM Stephen Boyd wrote: > > > > > > > textofs-$(CONFIG_ARCH_IPQ40XX) := 0x00208000 > > > > > textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 > > > > > textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 > > > > > > > > But what on earth is this? I just deleted this and the platform > > > > boots just as well. > > > > > > We need to shift the kernel text to start 2MB beyond the start of memory > > > because there is the shared memory region used to communicate with other > > > processors in the SoC there. It took a while for us to convince other OS > > > folks in the company to put shared memory somewhere else besides the > > > start of RAM, but eventually we won that battle. > > > > > > Does your booted kernel have its text section at the start of RAM or is > > > it offset by 2MB without this change? Check out /proc/iomem to see where > > > the kernel text is in relation to the start of RAM. > > > > The memory on this machine starts at 0x40200000 since the effect > > of the current code is to take pc &= 0xf8000000 and that results in > > 0x40000000 and then this adds textofs 0x00208000 to that > > resulting in 0x40208000 for the kernel physical RAM. Which > > is what we want to achieve since the RAM starts at > > 0x40200000. > > > > But TEXT_OFFSET is also used inside the kernel to offset the > > virtual memory. This means that when we set up the virtual > > memory split, the kernel virtual memory is also bumped by > > these 2 MB so the virtual memory starts at 0xC0208000 > > instead of 0xC0008000 as is normal. > > > > It looks weird to me but maybe someone can explain how > > logical that is? > > > > The ARM mm code assumes that the relative alignment between PA and VA > is 16 MB, so if we skip 2 MB in the physical space, we must do the > same in the virtual space. That is a good thing; it makes the virtual to physical translations easy - we only have facility for offsets with bits 23..0 clear to make the code rewriting simple. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel