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 BE19AC433EF for ; Wed, 2 Mar 2022 22:42:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1C67983D0B; Wed, 2 Mar 2022 23:41:47 +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="teOPuAjq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6846283C9E; Wed, 2 Mar 2022 23:41:45 +0100 (CET) Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (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 24E1283D0F for ; Wed, 2 Mar 2022 23:41:42 +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-xf36.google.com with SMTP id b12so2748292qvk.1 for ; Wed, 02 Mar 2022 14:41:42 -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=fZsnuHZJLeOJ3Xvyx85G6WIc1tGo8IBO3WkdbHoeKzA=; b=teOPuAjqduzNaYcTun8Zpdc7hEcUdOfyDDUXBNAE/jseKYPEXGevC1uRkNr7dHjK4a 4yK+ob06TdRQ2ml5cKEvY68wYnK6EphFdnVnYfqonjTKKLmningos1MzvwUY1eRizpsu n4fhJAnKN6a9oucK3fRaycErooUIfy/zlUA0w= 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=fZsnuHZJLeOJ3Xvyx85G6WIc1tGo8IBO3WkdbHoeKzA=; b=zs4MdEiB3zSI0g1DEd1/K9s8WGu+STEnmA8HC78O2aMgmmiA7AnXdN9eoWVCiDMbhJ kX6IIrg64Gh03iX+Lpk3kZxVhqd6scIWT0kbUstF1QlkZdrAKNywJ/YIgTuHyQgXUfNk SjrG8w5SpjF971x9Zh6xdxy6pKin+CJmfvbFyoLLeVqvwgNGGr4M2iLD+IaxXX3mjv1u 1t+KaKllt448Ab8ml3+FdyEgGfBm9rbgSR+IdzEmZuktK0jhnVkmUSlSZRSlJ2x941nm 3iEWMDHlbJ8eSosV6pssRIdaJAKOgTDK8zESQjFIOeqobBqLmvc+B2BjWgYBH9lQlalv TfHA== X-Gm-Message-State: AOAM532Au4FrqpyHUXAojzrN9Q9DngM9bdY6iaDCTan2sAbHpPNeIpxD FBUDo5xo5YzckxHix6NWbjOwug== X-Google-Smtp-Source: ABdhPJzzUpPc7CsbmHcbPBfuyx7xvWKzINDiv8JZjgVjpjIpCNlEPo6UX8O/pWccsvjta/lwJVeiKQ== X-Received: by 2002:a0c:fdeb:0:b0:432:9472:1887 with SMTP id m11-20020a0cfdeb000000b0043294721887mr21599632qvu.117.1646260901006; Wed, 02 Mar 2022 14:41:41 -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 z3-20020ac87f83000000b002deae661c08sm217432qtj.33.2022.03.02.14.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 14:41:40 -0800 (PST) Date: Wed, 2 Mar 2022 17:41:38 -0500 From: Tom Rini To: Andre Przywara Cc: Simon Glass , Heinrich Schuchardt , Michael Walle , Nishanth Menon , Alison Wang , Peter Hoyes , Marek Vasut , Priyanka Jain , Priyanka Singh , Mark Kettenis , u-boot@lists.denx.de Subject: Re: [PATCH v2 6/6] armv8: Fix and simplify branch_if_master/branch_if_slave Message-ID: <20220302224138.GZ5020@bill-the-cat> References: <20220211112939.1327953-1-andre.przywara@arm.com> <20220211112939.1327953-7-andre.przywara@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="63aIh6YiuHX+oBFP" Content-Disposition: inline In-Reply-To: <20220211112939.1327953-7-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 --63aIh6YiuHX+oBFP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 11, 2022 at 11:29:39AM +0000, Andre Przywara wrote: > The branch_if_master macro jumps to a label if the CPU is the "master" > core, which we define as having all affinity levels set to 0. To check > for this condition, we need to mask off some bits from the MPIDR > register, then compare the remaining register value against zero. >=20 > The implementation of this was slighly broken (it preserved the upper > RES0 bits), overly complicated and hard to understand, especially since > it lacked comments. The same was true for the very similar > branch_if_slave macro. >=20 > Use a much shorter assembly sequence for those checks, use the same > masking for both macros (just negate the final branch), and put some > comments on them, to make it clear what the code does. > This allows to drop the second temporary register for branch_if_master, > so we adjust all call sites as well. >=20 > Also use the opportunity to remove a misleading comment: the macro > works fine on SoCs with multiple clusters. Judging by the commit > message, the original problem with the Juno SoC stems from the fact that > the master CPU *can* be configured to be from cluster 1, so the > assumption that the master CPU has all affinity values set to 0 does not > hold there. But this is already mentioned above in a comment, so remove > the extra comment. >=20 > Signed-off-by: Andre Przywara Applied to u-boot/next, thanks! --=20 Tom --63aIh6YiuHX+oBFP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmIf8qIACgkQFHw5/5Y0 tywW8Qv/SkNQNfIRX/633NVnWyrEG5vG1G1FTda69oIB13K6p9KrEAnQLkwutu34 37FNdVIwFw6WwnlN25lGAYGtN/nuQreF+0fqNH+kBwZiQwi0yxPeQu/8tRMSvgFp CuJEI4jVSgHKdiBIxTmQwGZ/AyFe333iWM3hJFBvdTudpEQzW58kG4MqxJ+uLxM/ zgdJ5PGjj8yfAbIVEYXfiEUGCWpAZENK70oGEpIH+K2IglR1cu533pLXlTzZLJCB zSo2MwBInh8JsQNdpyRCrABvLYHEeoPOeERbRiagkaRBqfmA7EMPZLPuSFWdvJMP PIeWPdYHSH1eR0Y+I3VqOb5xp+dsu8dFuVlBnGnPAqD0yh5lLNYxE5ucCpsidh5P wtYiLvcKg9WoLG42ltt4kQu8xjIZT6i2L82ViWuvqhC0nseEVr108SbLFo0982Lq F9PoB7A6BNIs4LycvML4m0zgbBBqu25w4p3Xd5EZYdnmoszotOBUDgaCqn1Ryndo xMnXqSj0 =cSAX -----END PGP SIGNATURE----- --63aIh6YiuHX+oBFP--