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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9A792C54EBD for ; Fri, 6 Jan 2023 21:45:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 076E7853EB; Fri, 6 Jan 2023 22:45:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (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="n+zoBbVt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5977F853EB; Fri, 6 Jan 2023 22:45:48 +0100 (CET) Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (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 AE9BC853EB for ; Fri, 6 Jan 2023 22:45:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf32.google.com with SMTP id o17so1875527qvn.4 for ; Fri, 06 Jan 2023 13:45:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=T5OzLhk8iKutqi/8cB/xuRCBAX6ln3XAgxywVbYG2hk=; b=n+zoBbVtV/Luhobsi4FJAvNm3ANt6Yv5OJd8zSzhoc16CGRGI8H8DhSCZa508mEj3c HuX0DhVPwrvabS7qlEC+aJjufYRmJwvLhTy3GHHwCs13s23R4hkbLVKcJIl9ZoNOX8CT 6ozF78dTLPY8m+cdEjCeNAiMoeDSgKm145DC4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=T5OzLhk8iKutqi/8cB/xuRCBAX6ln3XAgxywVbYG2hk=; b=gorq9q5+FFgvQIM0+DxYmAan93p7TgcXNxolQkggyCZ5P36wRO1ePmsQRF6XlEoVhv yfhclWrDQeRiGtgjq2JugVY8Ovc6f6/UJHG9q1b/HWBWU/1EJ+WIW737vRnZVqk4ngmp pQcgkcwdy1HT+0W6Xd2LpGnn3LZnYMtywMnj4PiE1CcD/CCoJ2Cb1Tf4kdLtrUV7m+ro RuI0FtXyZUla/qdLjGX3sNkEg1/bYOWR1EdDRKB25Pe+bbC554Db1v5rFx+1ru983MB0 hslrghpMJSc5oKNLdyuycbB7GnhP4igAw+12Nif3OaY3jpjpgWc6uQiRmmi4t573zpmw oOTQ== X-Gm-Message-State: AFqh2kohHTd7t7ZVMjKaZLJhtsR4e3gh52FSOhI4OLr11YdVYFdO22N/ 7+lp/AbJeOsrZUoGa+/2yzXung== X-Google-Smtp-Source: AMrXdXuwTaCPZ6pG0AlST6iYP0lVrkU1CQphClrj6FSr4blJFepsf7R0V0tItv07N3Ys6gCCuuMp1A== X-Received: by 2002:a05:6214:4206:b0:531:b5c1:20be with SMTP id nd6-20020a056214420600b00531b5c120bemr36300582qvb.7.1673041544291; Fri, 06 Jan 2023 13:45:44 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-9162-adb5-1773-34c0.res6.spectrum.com. [2603:6081:7b00:6400:9162:adb5:1773:34c0]) by smtp.gmail.com with ESMTPSA id az31-20020a05620a171f00b006fbbdc6c68fsm1148154qkb.68.2023.01.06.13.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 13:45:43 -0800 (PST) Date: Fri, 6 Jan 2023 16:45:41 -0500 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: u-boot@lists.denx.de, Marek Vasut , Patrick Delaunay Subject: Re: [PATCH] Revert "common/memsize.c: Fix get_effective_memsize() to check for overflow" Message-ID: <20230106214541.GI3787616@bill-the-cat> References: <20230106155143.4025812-1-trini@konsulko.com> <20230106164543.3gtq73flpoocg7mc@pali> <20230106172524.GE3787616@bill-the-cat> <20230106202256.bvjwcfsjbhzsfgrh@pali> <20230106211408.GH3787616@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="A5e0DqnXrZMrl3tR" Content-Disposition: inline In-Reply-To: <20230106211408.GH3787616@bill-the-cat> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean --A5e0DqnXrZMrl3tR Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 06, 2023 at 04:14:08PM -0500, Tom Rini wrote: > On Fri, Jan 06, 2023 at 09:22:56PM +0100, Pali Roh=E1r wrote: > > On Friday 06 January 2023 12:25:24 Tom Rini wrote: > > > On Fri, Jan 06, 2023 at 05:45:43PM +0100, Pali Roh=E1r wrote: > > > > On Friday 06 January 2023 10:51:43 Tom Rini wrote: > > > > > This reverts commit 777aaaa706bcfe08c284aed06886db7d482af3f8. > > > > >=20 > > > > > The changes to this generic function, which is intended to help w= ith > > > > > 32bit platforms with large amounts of memory has unintended side = effects > > > > > (which in turn lead to boot failures) on other platforms which we= re > > > > > previously functional. > > > >=20 > > > > As mentioned previously, unfortunately this revert breaks 32-bit u-= boot > > > > on 36-bit mpc85xx boards with 32-bit e500v2 cores and 4GB DDR modul= e. > > > >=20 > > > > Which platforms currently have broken u-boot without this revert? T= he > > > > only one which was reported is stm32mp but for it there different > > > > workaround patch waiting in the queue. > > >=20 > > > Are you able to test on one of these PowerPC platforms currently? As > > > the stm32 problem shows, not everything is getting tested frequently > > > enough, so how many other cases are lurking out there. And, I think > > > overall issue is that the overflow check-and-change you introduce here > > > should just be in the CONFIG_MAX_MEM_MAPPED=3D=3Dtrue case. As that'= s the > > > case you're dealing with, yes? > >=20 > > I was planning to do big retest again after all powerpc patches are > > reviewed and merged... >=20 > Yes, but can you test one of them now, to see if my idea works? >=20 > > Anyway, if the issue here is with ram_size and its reduction was needed > > for mpc85xx (at the time of introduction of that patch), what about > > putting mpc85xx ifdef around ram_size reduction? For arm boards it would > > have same behavior as revert of that commit and for mpc85xx it would be > > no change. > >=20 > > I agree that this code needs to be revisited, together with ram_top > > issue and also code which fills DDR banks. Because really mapped memory > > for u-boot and real size of DDR are two different things here. >=20 > The issue here is that we see two now (given Fabio's reminder about > another thread I had forgotten) of unintended consequences, on 32bit > platforms trying to normally have 2GB of memory, which does not require > special treatment. What I'm leaning towards right now even, is that since it's hard to test the non-36bit platforms that do set CONFIG_MAX_MEM_MAPPED, to see if their behavior also changed here, the 36bit platforms should just be overriding get_effective_memsize. --=20 Tom --A5e0DqnXrZMrl3tR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmO4loIACgkQFHw5/5Y0 tyyoaAv+MLB2P1dA9+vovzRGuQpqasTmaA0gSIpsQ7hW0yCubcgCxTdjMkXLMs2k q8C/bEiKjdUBak/lKHjtA3ZJRVXJ2ao2D1Op/r5T5/P9C9n7WnZpeZoGgMGDXVJy gQV5KZiGR64dvXA/Iw+UsTzFHCaJCE4P3DDZmZ0WYSIxKvX0/JtNbL/mjCxycrLg UuwlN1VVkh0SwhXHm5LEMJktMgGVcKnPqPVGuSJU03ygUrmzTCKiJMfFAp3L+05t x643e+7qQZ7seZaQmdYExKCK3ZMzvT4pqxkeO0pC62qubDgBBSCvjyw5RG5vLIMs DwgaS7Dxc+cxKo4xQl8eBLBSoZJcTrooVTqTmEDAhlgWadQVD7jmTsSNqBbgVVQ1 mMQ9PN/Qxn8H9H8wAc/iC9q6fSA4VNbCfZi1elvIGbYqrSLWIqxW9yKnwwtWgcpJ Yy11ALE7yxf4D3Xdt2oKZ3SO//MFlZokYZdJKv6Suvb/M99TacPzpmEG6i+2nruO WhAyrWpf =7gjD -----END PGP SIGNATURE----- --A5e0DqnXrZMrl3tR--