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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB025C433F5 for ; Tue, 25 Jan 2022 17:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WJHcjm0H4i8WLlgzHo9JWMzHlSiiFnYAwANpcy7ZQ08=; b=uRhE8TgjOBg884gcQwhqvwKiBR EYN7B7DZu2T6RT0LhpsOh0q6j0HxETKq+0KvYcJErka7ZlLbzaDiZ/bp1H3Hn9X7gL9J6SrjEzL2t JjjIBWtq1hiYw8D1mtRm2v3OB/u0uA1Exon4X4Lb7mwPFqXTc918ryfB0kl9z60a0kXZ1T9Umvbu1 WleX6IIqcr5kyqjQBFL9JauhiMoRlVckh03fcAKf2TmP+dtpqfmq44QD+qt6u53gI/Bxwx0ma7Ktp Q9+vGHQQCETqzhrY5GT/HBMAP378ZYhVtKPlXwMqlrnJfl0doKiLKIa4EjZGoVEAII7sehXf9WZOG ixlVw9SQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCPsK-00965H-N4; Tue, 25 Jan 2022 17:45:00 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCPsF-00963R-Lh for linux-arm-kernel@lists.infradead.org; Tue, 25 Jan 2022 17:44:57 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AB26AB819BF; Tue, 25 Jan 2022 17:44:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5B4EC340E0; Tue, 25 Jan 2022 17:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643132692; bh=9WFUck55QSnxDjJOzJkPsG6ZYp780WqRZkvjwnYrFz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r0MFJVpY6ZzUutKbl/9VvtRCpxIzMhd4qgAY45djgTboXu1zskwnsZn8wQJtsbkuJ V2TYIPO6VrXDaAjTpIHOsfLFw8W4H2HUwffLYlNKoddp/Up2FoBtPsADPUaWPvcVCs +qwUAbTxkfmlRlxqf3/fFpjrdk86ZuBaXVZ5CuW5obO9u9K+t+uQdZCZD6Qy5VgPEH TUy+RqrViiG69+OGP97+96jeoJLrmTRXlNmdHiAGWbb55nYQDDSHvzoX9bS2U+ZCMn Qjxo1uz2KmXhlpozqxv6kRxBxyzFWDDe2998uSfGVkVxK0QyporzTr32fS7wCeYqJL FsNfLW97qGmvQ== Date: Tue, 25 Jan 2022 17:44:47 +0000 From: Mark Brown To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, andre.przywara@arm.com, jaxson.han@arm.com, robin.murphy@arm.com, vladimir.murzin@arm.com, wei.chen@arm.com Subject: Re: [bootwrapper PATCH v3 01/15] aarch64: correct ZCR_EL3.LEN initialization Message-ID: References: <20220125150057.3936090-1-mark.rutland@arm.com> <20220125150057.3936090-2-mark.rutland@arm.com> MIME-Version: 1.0 In-Reply-To: X-Cookie: The second best policy is dishonesty. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220125_094456_035744_771BDFDF X-CRM114-Status: GOOD ( 34.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0972087090388156472==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0972087090388156472== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="W/Z2WEh9T2a5BGjK" Content-Disposition: inline --W/Z2WEh9T2a5BGjK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 25, 2022 at 04:33:39PM +0000, Mark Rutland wrote: > On Tue, Jan 25, 2022 at 03:59:38PM +0000, Mark Brown wrote: > > On Tue, Jan 25, 2022 at 03:00:43PM +0000, Mark Rutland wrote: > > > As the same time, rename ZCR_EL3_LEN_MASK to ZCR_EL3_LEN_MAX, as it is > > > used as a value rather than as a bit mask. > > Well, it's both and we do call it a mask in both the kernel and TF-A > > too... > Here specifically in the boot-wrapper I'm just using it as a value, so I don't > see that those are relevant? That's also a bunch of the other usage - the kernel uses it to set the maximum available value by virtue of setting every possible bit in the bitfield, though it does also use it as a mask in places. > The idea was to be consistent with the __ naming, > and avoiding the "why are you programming a mask as the value" questions from > last time around, where the unambiguous options are: I've not seen that - I did see that there had been some discussion as to why the code had been including the reserved bits but hadn't seen any discussion of confusion between mask and max. > a) Use __ definition, as here. > b) Use __MASK, and add comments at each usage as to why we use > a mask as a value, to explain why that isn't a bug. > c) Have both __MASK and some value definition, and use some > insertion helper to insert the value. > ... and I went with (a) because it was the simplest. > Is there a problem with this? My concern is continuity of the enumeration algorithm between the various implementations we have, it's something we're not currently great with and this creates a separation between the kernel and the boot wrapper implementations. There's no change in what's actually being done but it creates some additional effort to figure out why we're setting a maximum here and not trying to set all the bits as we do in the kernel. TF-A is doing something else again (actually two different things if you include SME which uses the same algorithm for the streaming vector length), for SVE it uses a maximum length too but it uses a lower length than the maximum representable one that's used here. It may be that the best thing to do is to make this change but also update the kernel to have separate but identical mask and maximum definitions, though TBH I'd rather not actually have that update happen while the SME series is pending. --W/Z2WEh9T2a5BGjK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEyBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmHwNw4ACgkQJNaLcl1U h9B6dgf3U+PX39hr8zfb/0CFpxllwbCFvK2JNoR7Re7/3z3llSJID3R21DODul3a L3ZaxRNcnO5uwvXnrRFrVOZ7NGnoJ6I7K5ZcFENQFz7nbkTpRJ+5EtfmTieLif93 vvUXjijJhIZWCp9JX7xbudqtupPOjr9C8bq1/IUF8MO31n54YgpXkZ8QUlHheFzl xBxewQtT9o96/HhQkdciGhXSfiO/kuQnAtG2lNrUbiactF7eYsHE/Df/1asx/JpS oqAnya/ZyPTOj4TXm56qcXDD9mMlc/Hn/oriui7XTCR8KxPRDYqhtQYzvtSGlXWc rB5CIEuUtWgISelGpDJNb1c71Tej =26lk -----END PGP SIGNATURE----- --W/Z2WEh9T2a5BGjK-- --===============0972087090388156472== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============0972087090388156472==--