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 0A33DC43334 for ; Fri, 3 Jun 2022 19:48:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C8C684341; Fri, 3 Jun 2022 21:48:42 +0200 (CEST) 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="TPM8I+WX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3584484300; Fri, 3 Jun 2022 21:48:40 +0200 (CEST) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (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 0D0D9842E8 for ; Fri, 3 Jun 2022 21:48:36 +0200 (CEST) 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-xf29.google.com with SMTP id u8so6298281qvj.2 for ; Fri, 03 Jun 2022 12:48:35 -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; bh=RfHXGcKGxXR0s3SCImWrnNXx038uZMv5sOSjVfr0Y2M=; b=TPM8I+WX89oCJh8NygW9waEHRNzIajZnxRhk/AAAbfLq6z5Fu66eMCQ6DIdzBtGaTY PJ+OL0RIll6CQwF3Du2Tyg+JG/5mhvPim/s/gf+NmxIJFSHet3DZIm+6Prsr5Ip+OPzy PGGiI1B1DPmemTOft/XSMpNcdOK1v/394DNSw= 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=RfHXGcKGxXR0s3SCImWrnNXx038uZMv5sOSjVfr0Y2M=; b=nGWZx46PsBrVKgvikImG99z/fvasLTJx3N4FyEdylEeWpc5QrYmjGHBG2jlrcZDdOY c9g1UtmeP2Np78eFhh9jresUs3P6kvyrI87imdMmm4GMJzBDuV4vCQi+jzExcg+TKoDz LC+7WizbDWCOWVl/WuCn81iQtpn3Zr7kwNBkYns8ixmOG+dUHxiXivlZZGhENq2Go6Pn wdFLGEXa4MgFvHqNs7NkAXRzRf3wocpx3e0E//UdJ6G35nDK/4xgSmFA4A7fp8Dp/lJx B6l1Y3OliSVauSXc8gMEpnITfieZ18umNUecZErgGIT+MmPZ4qfwG6CRZDrgB5HUBYmv eqJw== X-Gm-Message-State: AOAM530/82s67VgfOKbPA4gZXMIYYlzD/sgdgYVt1G5Filk82iOyNajf dia7QeTviTsxd6jRp2zFzHxXFQ== X-Google-Smtp-Source: ABdhPJzrvm6QQ/3/8FVcD8hwjPej6xcyNfujHdCBvNEx4zw8wlKrRM/JhQlryC/WfprdWUHGEqB4LA== X-Received: by 2002:ad4:576b:0:b0:464:647e:b2a4 with SMTP id r11-20020ad4576b000000b00464647eb2a4mr14543675qvx.71.1654285714501; Fri, 03 Jun 2022 12:48:34 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-f800-5c43-9e45-17fb-de1a.res6.spectrum.com. [2603:6081:7b01:f800:5c43:9e45:17fb:de1a]) by smtp.gmail.com with ESMTPSA id l8-20020a05620a0c0800b0069fc13ce1d7sm5552858qki.8.2022.06.03.12.48.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 12:48:33 -0700 (PDT) Date: Fri, 3 Jun 2022 15:48:31 -0400 From: Tom Rini To: Andre Przywara Cc: Simon Glass , u-boot@lists.denx.de, Balaji Anandapadmanaban , Peng Fan , Andy Yan Subject: Re: [PATCH] armv8: Fix TCR 64-bit writes Message-ID: <20220603194831.GG1958597@bill-the-cat> References: <20220509160849.246793-1-andre.przywara@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yZnyZsPjQYjG7xG7" Content-Disposition: inline In-Reply-To: <20220509160849.246793-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 --yZnyZsPjQYjG7xG7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 09, 2022 at 05:08:49PM +0100, Andre Przywara wrote: > The AArch64 TCR_ELx register is a 64-bit register, and many newer > architecture features use bits in the upper half. So far U-Boot was > igorant of those bits, trying to leave them alone. > However, in an effort to set bit 31 to 1, it failed doing so, because > the compiler sign-extended "1 << 31", so that all bits[63:31] got set. >=20 > Older ARMv8.0 cores don't define anything dangerous up there, but newer > architecture revisions do, and setting all those bits will end badly: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > $ qemu-system-aarch64 -cpu max .... > U-Boot 2022.07-rc1 (May 09 2022 - 15:21:00 +0100) >=20 > DRAM: 1.5 GiB > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (hangs here) >=20 > Defining TCR_ELx_RSVD to "1U << 31" avoids the sign-extension, so all > upper bits stay at a safe 0 value. This means no more surprises when > U-Boot runs on a more capable CPU core. >=20 > Reported-by: Balaji Anandapadmanaban > Signed-off-by: Andre Przywara > Reviewed-by: Peng Fan > Tested-by: Peter Collingbourne > Reviewed-by: Peter Collingbourne Applied to u-boot/master, thanks! --=20 Tom --yZnyZsPjQYjG7xG7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmKaZY8ACgkQFHw5/5Y0 tywRtwv+PmGFmjjaT+5cGEEH8b18+ZHFuJUArFsUugrufLczZNTw+QXDQxYMVCek tJgluiZ5CHLSEtBIB323jTs7fXMnMJIoclf+Ev0ZwwH9IW0XtUKosfgPwgtGnQNh YrOMQPh0bOjnhIc1Pn44neYlQnVnddie97HUes9LaLHnmOHtIv45s9A2zfA4mWZ2 wXYEfiEMda19NcbayN4q3Ka0fX/Tbkiq/1nKQd3Wc1wJXtTbU0KPhsJWoII5+nWi pH5I2xEsJlHLPlZUlyovQpsEWwDug2YqHfNzjUuZ7/lPTj5Yc96yfjoxJqUhB7bC 1vrESGqA73AYLM2thqkdgawU7wgSF3JXDb6JKovOAKAo33aznKKLJ7plEsfKbOxA gbxXs/VQ8gAu0w8/YMeKhlD7DtaXfgyev/lCj7aTMdodV2WtMzltdTThJcpVJCAk okCl/yXbJr3l7v2u5DBlECg1Wy65lqBPjJXDwsdfY3jm6W3IsQ26m1Q85wvZd1bn D1ZPl4tQ =rLBN -----END PGP SIGNATURE----- --yZnyZsPjQYjG7xG7--