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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 202D1C4338F for ; Thu, 29 Jul 2021 16:58:20 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B8D060F43 for ; Thu, 29 Jul 2021 16:58:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4B8D060F43 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD80082F0C; Thu, 29 Jul 2021 18:58:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="gUJ0IrMO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A2E3C82F0C; Thu, 29 Jul 2021 18:58:14 +0200 (CEST) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8061C82E1A for ; Thu, 29 Jul 2021 18:58:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf30.google.com with SMTP id 3so3735754qvd.2 for ; Thu, 29 Jul 2021 09:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=s3LEhDr2c3zBGQrOrkj3c+OAY3lMRxnskFIbLHWc4K8=; b=gUJ0IrMOtqCpIlWVCzgR/NT9OwyYYmFhCUjaYWVpjOo9fkhTwPX1B8sdyZdnPgABmU nIMtLqtlDY4ZosBeImDWCIPwfEL6Wjr4BTf5h69Q5HhDXJT2wR6ZuHT1SOlQnf2Sar4H 99AIjXMPhwJlAAI7fWf1eAOHjSSVSLvtCA8+w= 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=s3LEhDr2c3zBGQrOrkj3c+OAY3lMRxnskFIbLHWc4K8=; b=qsuwjqBZYux1OPuVfl/QgUDSf49XDlb1fvn2EWSJqpsAPtNO84KiQM6IzF0GW/weiA jdrJC3iRql/on/4DOoPQfY0F6fa9Er49crC9QvoqcE96KdPcfaIdheWH0ULOTJmf9pBL rM31sx7jws/BCdROS+5xBm8GSeAoV/AbMbzBmi53zaExqsKWnBk5qSWq5sRI+EsikFUt 41w9w+0COgM2bKC2x3JFWuelEaJVrcI0l15RqEEgN1X6X2eKKJWFD2vfU4eaPeZ/6cmo aGHLL4N3H9Hr4NqNoSrpcKWnpjFFMB+4Np2P6k2stKqoUe6MVsAVK5SM7NvcxLR79FOp C8KA== X-Gm-Message-State: AOAM533VaC423A63IeGFiRUy6EAl80SeNvKYaCYRoThrAgMt6npR5k6s WrCCjupl3Ef9GkViNWsHLiQ8aw== X-Google-Smtp-Source: ABdhPJxdwyLPwB8sFFoXbcP3ObESxXnVq2NipSIwARk4v9Cb74mxUy40cVBwajb/2pkIrQU8NP6XTg== X-Received: by 2002:a05:6214:d08:: with SMTP id 8mr6345706qvh.32.1627577885362; Thu, 29 Jul 2021 09:58:05 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-94ed-10de-2168-2ec4.res6.spectrum.com. [2603:6081:7b01:cbda:94ed:10de:2168:2ec4]) by smtp.gmail.com with ESMTPSA id l4sm1452231qtr.62.2021.07.29.09.58.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jul 2021 09:58:04 -0700 (PDT) Date: Thu, 29 Jul 2021 12:58:02 -0400 From: Tom Rini To: Marek Vasut Cc: Jan Kiszka , U-Boot Mailing List , Hai Pham , Simon Goldschmidt , Stephen Warren , Lokesh Vutla Subject: Re: [PATCH] Revert "arm: bootm: Disable LMB reservation for command line and board info on arm64" Message-ID: <20210729165802.GA9379@bill-the-cat> References: <1971775f-28de-83d0-9459-a4e68c744a18@siemens.com> <20210729152307.GP9379@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SRANlrd+GMVhaYmh" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --SRANlrd+GMVhaYmh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 29, 2021 at 06:47:02PM +0200, Marek Vasut wrote: > On 7/29/21 5:23 PM, Tom Rini wrote: > > On Thu, Jul 29, 2021 at 05:01:09PM +0200, Marek Vasut wrote: > > > On 7/29/21 9:22 AM, Jan Kiszka wrote: > > > > From: Jan Kiszka > > > >=20 > > > > This reverts commit 2359fa7a87848626bcbd3399e92c657595880cd7. > > > >=20 > > > > While the goal is valid and there is surely unused memory in that a= rea, > > > > we also have a lot of crucial things still located at the top-of-me= mory > > > > while running lmb_alloc_base. Such things are the page table (tlb_a= ddr), > > > > relocated U-Boot and the active stack. Possibly more. So this patch= was > > > > premature, we will need relocations of those things first if we wan= t to > > > > use the range. > > > >=20 > > > > Fixes booting on the IOT2050, but likely also on other boards. It g= ot > > > > stuck on relocating the FDT - over the relocated U-Boot code. > > > >=20 > > > > Signed-off-by: Jan Kiszka > > > > --- > > > >=20 > > > > Practically, > > > >=20 > > > > void arch_lmb_reserve(struct lmb *lmb) > > > > { > > > > lmb_reserve(lmb, gd->relocaddr, gd->ram_top - gd->relocaddr); > > > > } > > >=20 > > > So this is wrong and breaks a use case on rcar3, where there is more = stuff > > > which should not be reserved until the ram top. > > >=20 > > > I suspect the real fix here is to protect only the stack and tlb on a= rm64, > > > not just everything from current stack bottom to ram top ? > >=20 > > Wait, what? There's never been a U-Boot release that didn't reserve > > that area >=20 > That does not mean such a huge reservation is correct. > I apologize for not being overly clear in my answer, I already told Jan I= am > highly overloaded and simply lack the capacity to analyze this problem > thoroughly on a short notice. I understand. > > so when did rcar3 introduce something there that shouldn't be > > reserved? And you had phrased this to me on IRC as about reserving spot > > for ATAGS, and that not being needed of course on arm64. But that's not > > what's going on. Perhaps the answer is that rcar3 needs to introduce a > > board_lmb_reserve to free the normal arch one and provide whatever more > > narrow scope it needs. >=20 > Based on the commit message 2359fa7a878 ("arm: bootm: Disable LMB > reservation for command line and board info on arm64") , this is about AT= AGS > and we really don't need to reserve those on arm64. Commit 2359fa7a878 disables the entire arch_lmb_reserve function on aarch64, yes. I assumed when we had talked that it was a small area being set aside and perhaps mis-recalled that ATAGS tended to live at DDR_BASE + 0x800 or so. This reservation is not at that spot, and a lot more than that. That commit is also only present in v2021.10-rc1 so it's not a great idea for another project to depend on it and can also revert their changes until someone is able to analyze the entire situation again. > I didn't hit the tlb reservation issue Jan has in my tests on rcar3, so I > suspect that is the real problem here, i.e. we need some more fine grained > lmb reservation on arm64 ? Yes, some further analysis is needed here. But due to a lack of time I suspect the best answer for now is for rcar3 to add board_lmb_reserve() and lmb_free what's not needed there. --=20 Tom --SRANlrd+GMVhaYmh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEC3hoACgkQFHw5/5Y0 tyy/IAv/dRbzWzCJJwkS0zZl4F74GaKW30nzZD76aYivBaotr3twwsIj3crIzA7N A02ZPK/2wEziOoKq17HbiPKq83gknrwPiwEfOJfnlcIGqYfd6FTtdpqWAVWY7P26 qd1z4vmx7gBZPknIgX3HqiQTqpjZpD98gxwEIYKRxJeRK7CJvCIsp8dJzBKWJ+AG HHoNeBmO9dwKkT3e4vzFXe/J6ZJDGTsuAXIWqG/CREX2GzFo2U/KTHZGXK3goVfO cieqhkfC/6j64UwkFz/djj2kGaN0iAWtXTjRoy7KySjKoX3nBsCcC4QyxeqzGNc/ afvBkCPp/9abguqGEYCmZAHlQGpRdKOBvyIj51AaYS5s/ZIFLxDeYbLQm9+rlyam r+wVwPk8d+TBljbl4ryLtTkccEO9giszptMMatmFopXL9ZQB1WlOFiVQm9bnVdaq Xyq8EVS5HfMK0V+l+5NXrz0poqXJVnSWyTVY2q+8k/3R3q2Hwig56Cg+zb7TpvvX HCE9ORDJ =dopm -----END PGP SIGNATURE----- --SRANlrd+GMVhaYmh--