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=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 86AAAC433E1 for ; Mon, 3 Aug 2020 10:18:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A6A020738 for ; Mon, 3 Aug 2020 10:18:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbgHCKSU (ORCPT ); Mon, 3 Aug 2020 06:18:20 -0400 Received: from mail-oo1-f67.google.com ([209.85.161.67]:34885 "EHLO mail-oo1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbgHCKSU (ORCPT ); Mon, 3 Aug 2020 06:18:20 -0400 Received: by mail-oo1-f67.google.com with SMTP id j19so1505172oor.2 for ; Mon, 03 Aug 2020 03:18:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bLwWjtcCNGtJBDj5GnvmiZWK/Yy4sV+kbUnqu0SuzU0=; b=CHhy7r78BAPiNEY3XBfLE62YfV1dUSkMguvm822lfs1vmi9zf/PEfBEM1fNf1HtAQv szgpncNG8eioDN8E2xM4xhjz7MeP2WLy8I4ZglwyAPLbYkbmoVFOv6s06kkYpT5Cke7v 1SFFBmkF+o6LPGtmoYCeXOpng+ZyFFXR0ZE1WNX/+STgQEdLfEEjds412ZoDiCQNBMRJ tEGfjpxw6hOUIxUWwItWH+8SVm6rOpPbxwjO+JTFGILX5ijsNu7uwi+ZAZk21kLuJIl/ 1pIYb/gAC9Gj88CrwvrZHSexJrYCoZVPRfhqmuoEKa9r2cICkN5oUOp7c7uGzT/zZWzL 5RaQ== X-Gm-Message-State: AOAM5329HRbDxBDsHSUO8jqH2RIsXkO/UnaIJm5E9xbDibKNRLftDVuH e90H/ferJAYFcdZjjkXSzGiyJWeizqpiNZAJRm4= X-Google-Smtp-Source: ABdhPJwnKmkCVYo98rx0Po1sai5Wd4TAMwjpdWXT81E+blY7ioGikSgG1JNdowIMZyWBcNFp5U1P8DHjT30tgqL1CPo= X-Received: by 2002:a4a:4201:: with SMTP id h1mr4585302ooj.1.1596449899082; Mon, 03 Aug 2020 03:18:19 -0700 (PDT) MIME-Version: 1.0 References: <20200706150205.22053-1-geert+renesas@glider.be> <159546718359.3847286.13460778905630969897@swboyd.mtv.corp.google.com> In-Reply-To: <159546718359.3847286.13460778905630969897@swboyd.mtv.corp.google.com> From: Geert Uytterhoeven Date: Mon, 3 Aug 2020 12:18:08 +0200 Message-ID: Subject: Re: [PATCH/RFC v7] ARM: boot: Obtain start of physical memory from DTB To: Stephen Boyd Cc: Arnd Bergmann , Bjorn Andersson , Laura Abbott , Linus Walleij , Kumar Gala , Geert Uytterhoeven , Nicolas Pitre , Masahiro Yamada , Lukasz Stelmach , Russell King , Linux-Renesas , Chris Brandt , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Eric Miao , Dmitry Osipenko , Ard Biesheuvel , Linux ARM , Marek Szyprowski Content-Type: text/plain; charset="UTF-8" Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Hi Stephen, On Thu, Jul 23, 2020 at 3:19 AM Stephen Boyd wrote: > Quoting Linus Walleij (2020-07-21 05:58:59) > > On Mon, Jul 20, 2020 at 11:53 AM Arnd Bergmann wrote: > > > No idea what /exactly/ is going wrong, but I would point out that this is one > > > of the platforms that is handled as a special case in the Makefile when > > > setting TEXT_OFFSET: > > (...) > > > 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. I think the problem > is the decompressor would have to parse the reserved memory sections in > DT to figure out that it shouldn't decompress over shared memory, and > changing the decompressor to do that was deemed "hard". Does this patch > series resolve that? As this patch adds C code to extract the start of memory from DT, it should be quite easy to add code to filter out regions marked reserved in DT. In fact that would be a prerequisite for making this work with crashkernel support (+ making the crashkernel code mark its memory as reserved in DT). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds 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=-4.0 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,URIBL_BLOCKED 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 2FBEBC433E0 for ; Mon, 3 Aug 2020 10:19:50 +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 F16E020678 for ; Mon, 3 Aug 2020 10:19:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="I6blPa/Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F16E020678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=r38Fq0IyZ56etqetZSaNlzUy//mBkXs5yFzZ1N8eZxg=; b=I6blPa/QWgfZgDmfzn6Am7ka/ J6prfFF1+OAGCGk8iN7FM2iXW5S4FQe3DXH7pZy4QEhpcIUUv2rDz+7BLj+s3g4g8qFwkH8F6yuvg aqaUKSfsAO85kH2SFVdlBsYKjH+EB327an71G4d4xnDJF72x6yrYgjHXQXxE1ZAM2x8ANFoLUtcSO JMRcWayrZEJwCzWL5eX/U7gGELUOgZ4HocDPI5kCOI8hlsXI4jwc2fk9VHgILOgoVZ34xqDdGn27H HhLQ25haxCQwTPFXsofg31ujkyhgIAmjkKhZ2y4o9Ir9rSaRgeZ8ZMqKMqz73CVugkCewb4sLCKR6 JkqVX1TVQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2XXy-0007dK-Hl; Mon, 03 Aug 2020 10:18:22 +0000 Received: from mail-oo1-f68.google.com ([209.85.161.68]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2XXw-0007cF-C5 for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 10:18:21 +0000 Received: by mail-oo1-f68.google.com with SMTP id z11so370534oon.5 for ; Mon, 03 Aug 2020 03:18:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bLwWjtcCNGtJBDj5GnvmiZWK/Yy4sV+kbUnqu0SuzU0=; b=sks+D3KG5KSunlauxHkfTdEq3ojMRSsXVqx+ew28GdMh2jexKIuAzaLsnHKJUsxwk+ j+yIrYh7/H7TcM2uhu+ZNNUirefXR8SYyQcCpJsCdMK0K1+ig+Z/NbfrC9JXiPp0Hwkh 2CKPr2B9HBXXlPZEXR72GJ420yjzrnOTN47pX/7B6zC4xB9Yq1zB4K/oEgHxf9Hs32Kh Zhjh/dKakhE0c2zplq+AotnxbEzKQrio1ciQUSyL3VlVMI9k7wFjf9mNjGHmEKkg8lpn zgjJiuUo6ynTgfRLAAgjhdilh3PsyJ5l/xx4WWrDC3WlcCw7s/gXWHir+2ATYsF+ccPn /snQ== X-Gm-Message-State: AOAM530irhyr+q9/2vVns6bhJZzc074iGgNYfY902AoJeOjLXiYwuuS+ 4ANhFbr0Ks1Reb3aLhjkvVeP027KXKxrQlb7Yrs= X-Google-Smtp-Source: ABdhPJwnKmkCVYo98rx0Po1sai5Wd4TAMwjpdWXT81E+blY7ioGikSgG1JNdowIMZyWBcNFp5U1P8DHjT30tgqL1CPo= X-Received: by 2002:a4a:4201:: with SMTP id h1mr4585302ooj.1.1596449899082; Mon, 03 Aug 2020 03:18:19 -0700 (PDT) MIME-Version: 1.0 References: <20200706150205.22053-1-geert+renesas@glider.be> <159546718359.3847286.13460778905630969897@swboyd.mtv.corp.google.com> In-Reply-To: <159546718359.3847286.13460778905630969897@swboyd.mtv.corp.google.com> From: Geert Uytterhoeven Date: Mon, 3 Aug 2020 12:18:08 +0200 Message-ID: Subject: Re: [PATCH/RFC v7] ARM: boot: Obtain start of physical memory from DTB To: Stephen Boyd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_061820_457696_3E642F81 X-CRM114-Status: GOOD ( 24.90 ) 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 , Arnd Bergmann , Geert Uytterhoeven , Nicolas Pitre , Ard Biesheuvel , Linus Walleij , Lukasz Stelmach , Russell King , Bjorn Andersson , Linux-Renesas , Chris Brandt , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , 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 Hi Stephen, On Thu, Jul 23, 2020 at 3:19 AM Stephen Boyd wrote: > Quoting Linus Walleij (2020-07-21 05:58:59) > > On Mon, Jul 20, 2020 at 11:53 AM Arnd Bergmann wrote: > > > No idea what /exactly/ is going wrong, but I would point out that this is one > > > of the platforms that is handled as a special case in the Makefile when > > > setting TEXT_OFFSET: > > (...) > > > 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. I think the problem > is the decompressor would have to parse the reserved memory sections in > DT to figure out that it shouldn't decompress over shared memory, and > changing the decompressor to do that was deemed "hard". Does this patch > series resolve that? As this patch adds C code to extract the start of memory from DT, it should be quite easy to add code to filter out regions marked reserved in DT. In fact that would be a prerequisite for making this work with crashkernel support (+ making the crashkernel code mark its memory as reserved in DT). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel