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 67B83C433F5 for ; Fri, 4 Feb 2022 00:41:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E734283A34; Fri, 4 Feb 2022 01:40:44 +0100 (CET) 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="DXAAHq/A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 03E7683A51; Fri, 4 Feb 2022 01:40:44 +0100 (CET) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 785E883A30 for ; Fri, 4 Feb 2022 01:40:40 +0100 (CET) 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-qk1-x72f.google.com with SMTP id 13so3510617qkd.13 for ; Thu, 03 Feb 2022 16:40:40 -0800 (PST) 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; bh=qQ2/a3ADYZqByONFbQ5wTw2uni4MZXvZU4sIEFwo8L0=; b=DXAAHq/ApeaSHJ/Q8yn+Xg5L/fqWrvleSYApltiXDl6VcVwjitX6zKvQTHNBCPQdB6 nB4/4xUbinpqTg1pRnFl7mFVqUIGHwhGEJgRJhyY2eRv8RxWRbBDKZOHFsJDBhsaB4AT HVqgayFsjjRM2VzZbHRsEa55mb8xHB6c+4XqE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qQ2/a3ADYZqByONFbQ5wTw2uni4MZXvZU4sIEFwo8L0=; b=UJ2NOMTQGYCwyhY3CBurLRGRKQuC5gZc6WAZwmhbHrblX5ftVsCOW1/lr4LXDrPakW WKqc53lmEbRzgH2FsGXYXWMazyoIeeHEAylrFGX25/Qj76/6MpATX1DW+Lu/1/Lcmcmd Au3NSXh67NDEWi1LyF0+ZV/uiD3Q/MXJCGqSsdOq4Az8zbOxVpcRoLEsl/adhowKGcar nbWkMJlIY8a2fhLvAyCYjCeFmrxF7NOAtKlLXouEGGhWUt9o4XnCF1VShmo+YDJXUcHg Rz0orONwNveyTo4lVYY0Uc4teXEbEjf8vWw5r+D+jKxdxIosaN5s7weBtKRZxG2wY6dl v0Bg== X-Gm-Message-State: AOAM532vpD1Z3CEaeTE7YI2BzHEtilYttr2kPtzZDulqWSIMf88zvHto rzY/42kRXw/2QdLYpVWTwG+y6g== X-Google-Smtp-Source: ABdhPJyzZer+1nscpGi5C3xE24dhFerY5qfbryLK7baWnhLEjPpqWaZuzFCsYZgDFvZeomU/nvlSnQ== X-Received: by 2002:a37:65cd:: with SMTP id z196mr360465qkb.620.1643935239335; Thu, 03 Feb 2022 16:40:39 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id bq33sm242981qkb.64.2022.02.03.16.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 16:40:38 -0800 (PST) Date: Thu, 3 Feb 2022 19:40:36 -0500 From: Tom Rini To: Andre Przywara Cc: u-boot@lists.denx.de, Mark Rutland , Marc Zyngier , Mark Kettenis , Michael Walle , Simon Glass , Peter Hoyes Subject: Re: [PATCH] armv8: start.S: remove CONFIG_SYS_RESET_SCTRL code Message-ID: <20220204004036.GG7515@bill-the-cat> References: <20220124171740.3285854-1-andre.przywara@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fs3dgQsp/rzZxMmQ" Content-Disposition: inline In-Reply-To: <20220124171740.3285854-1-andre.przywara@arm.com> 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.5 at phobos.denx.de X-Virus-Status: Clean --fs3dgQsp/rzZxMmQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 24, 2022 at 05:17:40PM +0000, Andre Przywara wrote: > There is some code that tries to "reset" the SCTLR_ELx register early in > the boot process. The idea seems to be to guarantee some sane settings > that U-Boot actually relies on, for instance running in little-endian > mode, with the MMU off initially. > However the current code has multiple problems: > - For a start, no platform or config defines the symbol that would > enable that code. > - The code itself really only works if the bits that it tries to clear > are already cleared: > - If we run in big-endian mode initially, any previous loads would have > been wrong already. That applies to the (optional) relocation code, > but more prominently to the mask that it uses to clear those bits: > "ldr x1, =3D0xfdfffffa" looks innocent, but actually involves a memory > access to the literal pool, using the current endianess. > - If we run with the MMU enabled, we are probably doomed already. We > *could* hope that we are running with an identity mapping, but would > need to do some cache maintenance to avoid losing dirty cache lines. > - The idea of doing a read-modify-write of SCTLR is somewhat > questionable to begin with, because as the owner of the current > exception level we should initialise all bits of this register with a > certain fixed value. > - The code is unnecessarily complicated, and the function name is > misspelled. >=20 > While those problems *could* admittedly be fixed, the point that is does > not seem to be used at all at the moment tells me we should just remove > this code, and be it to not give a bad example. >=20 > If people care, I could introduce some proper SCTLR initialisation code. > We are about to work this out for the boot-wrapper[1] as we speak, but > apparently we got away without doing this in U-Boot ever since, so it > might not be worth the potential trouble. >=20 > [1] https://lore.kernel.org/linux-arm-kernel/20220114105653.3003399-7-mar= k.rutland@arm.com/ >=20 > Signed-off-by: Andre Przywara Applied to u-boot/master, thanks! --=20 Tom --fs3dgQsp/rzZxMmQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmH8dgQACgkQFHw5/5Y0 tyy/3Qv/f2DUXe3z7DrWTTPX0Aw2qSCEw+/sSdf5139apMD23p1x8bt/DPxqnkjO CMrJpCOzYnxtk/5uhNJ6i0o+6610bLZLzhz6C9cV+9ooMRwdlYPLLpLocQi+kYNQ IJh9v0g3pVW6WHhmZFy4513pQGvOdecVzekuKVsmhQ0DnA1QV666r/JJIfLOGOGW n97Id0ahOoOXNIabCPNjkoU9vH2OqlDH6K/9GWewAcwMRyttpVx8Xcn4bG+qBZTB +9dZRvLvYDKhKYP4x03laIIUN3wQcGoIVwQcw+X6Na7IX0/VyVOOfFjrJbVGDZ35 ATZSwoKHNURX6uCg8TRGatli13QjjBPll01wRS6kx7EFS0BqZtfuXAZOkSXB0OKz B1dQH4qzgGs8qk/xj8VyjwE7J53lwPzKS5UG6Mu6MvM6x97nJ7waT6nG/xTOpI8T PoHlhTl6m9AMC0WARNt8mkXvC4MrZ9/Pyfn/2XHObZUCbtPl9HEzyDUxMv7u0KwJ wey3QF9O =ZFyn -----END PGP SIGNATURE----- --fs3dgQsp/rzZxMmQ--