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 4D2A7C433F5 for ; Thu, 21 Apr 2022 14:51:54 +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=4NkpjTcVohalk05Dd0XrUINl4oy3iZ9KNeI2LJ8uhb0=; b=WSrENQsXbq6swXHEudX4fBYaVM 4d92zEa2CkTqvxCt5VTGvyZebB7fnlZM32dqnSg4hHvUZk11+/eXDF+mP+DoynY2GhpK1BF2Z33+8 npWP+epOVuDNvsURdu2/sx23mD0EcMV+Rlq6s02OExG/2o9y4K9CcgPvdfaY46zeg090YIe5y9xyz PoeM7avW+7o5Ma93Z6rsQKWl1R962uedLR1+p3zl/J6J9QXSBHRsxX3Q6MXTICia006t3WLG6DAlr VZ4RL04vDwC96BrO+fWU8lFXOWL0s3Fr+rr+ymaixg10uvpGAlWTkw/HTtE5HyftwS7T5666KSMzr /EeYtV6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhY8y-00Dt3q-He; Thu, 21 Apr 2022 14:50:52 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhY8u-00Dt1I-Gm for linux-arm-kernel@lists.infradead.org; Thu, 21 Apr 2022 14:50:50 +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 dfw.source.kernel.org (Postfix) with ESMTPS id D63B161AD1; Thu, 21 Apr 2022 14:50:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3517C385AA; Thu, 21 Apr 2022 14:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650552646; bh=W1W+d1AF1wHRT3s87Sxwnt0XEHd+XrDMx9PqYekXuOc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FLNp59qAycTyVcdTlPIBiS0jNiZvtWX7D4pTc1kQUurNeGeQ8GD3xfHaO6+1gkynu ETIXoxgvXk9I4g99z4GZckQHDUUxs01E4gAggXHs7oLxeETZts9Fv/4Y/MQQjl7qia AaS23a7HpDKRGvnjKxaCN7/xnbsPG575bFwaajKS+D+5jxEW6XRz1RPRE+GaJ6nGyG 4QDCGVQ+Gczrl/H7w3CNJ99s3ORMAgrZJg5jDVJuQZdPx8YXZlQB1zU4dCi+uQcSrW EuuA8wE5GQsE3/xqMzpSpWZEmxHCYtv6g0Z6KGjDkRJczBZseIZz8S0IHTlzAUEixi aPjBPrUt4/FYg== Date: Thu, 21 Apr 2022 15:50:41 +0100 From: Mark Brown To: Mark Rutland Cc: Catalin Marinas , Will Deacon , Marc Zyngier , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 4/8] arm64: Add sysreg header generation scripting Message-ID: References: <20220419104329.188489-1-broonie@kernel.org> <20220419104329.188489-5-broonie@kernel.org> MIME-Version: 1.0 In-Reply-To: X-Cookie: Two percent of zero is almost nothing. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220421_075048_660142_B20B6CE8 X-CRM114-Status: GOOD ( 39.74 ) 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="===============4814785917605432728==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4814785917605432728== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6SsY32fLZILeEXZT" Content-Disposition: inline --6SsY32fLZILeEXZT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 21, 2022 at 03:16:52PM +0100, Mark Rutland wrote: > On Thu, Apr 21, 2022 at 02:00:17PM +0100, Mark Brown wrote: > > > > The script requires that all bits in the register be specified and = that > > > > there be no overlapping fields. This helps the script spot errors i= n the > > > > input but means that the few registers which change layout at runti= me > > > > depending on things like virtualisation settings will need some man= ual > > > > handling. No actual register conversions are done here but a header= for > > > > the register data with some documention of the format is provided. > > > It would be good to see an example of how we'd handle one of those, i= n case > > > that means we need to play around with naming or structure of the def= initions a > > > bit. > > My thinking here was that we might not want to handle those registers > > through the automated stuff at all. I haven't yet come up with > > something that seems tasteful and viable for them, if I had a firm idea > > for what that should look like I'd probably have implemented it. > Sure, and I'm not expecting that we automate all of that, just that we > have an idea of how the manual bits would work with the automatic bits. > If the odd cases looks simple enough, we might be able to get away with > a couple of small additions to the scripting. > For example, for ESR_EL{1,2,3} today we define ESR_ELx_field > definitions rather than duplicate ESR_EL1_field / ESR_EL2_field / > ESR_EL3_field definitions. If the scripting has a mechanism to handle > that, then that might be good enough for the other odd cases. Ah, that's a separate issue to the registers which change layout which was what was being mentioned above. > For example, I think we could do something like: > # Define a set of fields without a specific register encoding, using the > # name `ESR_ELx` > SysregFields ESR_ELx > Res0 63:37 > Field 36:32 ISS2 > Field 31:26 EC > Field 25 IL > Field 24:0 ISS > EndSysregFields Yes, I'd been thinking of something like this - it seemed an obvious enough extension. > # This could instead be SysregEncoding > Sysreg ESR_EL1 3 0 5 2 0 > Comment "See ESR_ELx for fields" > # Don't create any field definitions for this reg, and don't > # bother with the associated sanity checks > NoFields=09 > EndSysreg I think we're going to end up wanting to still generate the numbered versions for use in macros so we should probably have that comment and NoFields be a SharedLayout (or whatever bikeshedded name) statement. Until we need it that can just be equivalent to a comment, ready to kick in once someone needs it. I can update the existing (trivial but meh) TTBRn register conversion to do that. > ... and the `SysregFields` `NoFields`, and `Comment` mechanisms might be > good enough to cover the other odd cases we have (e.g. aliased > GIC registers, or different "views" for the same register). > Does that make sense, or have I misunderstood the point you were making? I was talking about a completely different issue, things like CPTR_EL2 where the register layout changes depending on some runtime configuration. You'd need two separate register layouts within a single Sysreg which isn't too bad until you get to the point of having to name things like RES0/RES1 and any name collisons in fields (I don't *think* we have name collisons...). --6SsY32fLZILeEXZT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmJhb0AACgkQJNaLcl1U h9BhRQf/YZGigZ5YcoyI0BfOUUAHS6g8wqusLiaNCicJjZ3fH8AjA51UpTaKlBQI WOMkmsO5Pph6vWuE//9kF9YbI5dxzNR1zWChyrXwZjbiOUAEBw0zSx+VD8iUPQaf QdgLz8OoMKaYLFOXabLl/5BukVIMfkFqlJEWoLpZo+LDRdQ7FSgRmSvF1libf5O/ FJ/NrWJWJP+nRyuKrFV5vKm31ew8ZwMmNmt/F5etHZq1ADLI4w5ZTsehtUfNWyp/ vr5LQ08zdQi0L8TUFPSm8WtDjv4h1PFZyFGndjkbCBTeDNurc4X8YvmuEowyqMBG PSY8oyS12TmkHH/71twRaaBPCaiQWw== =2bxK -----END PGP SIGNATURE----- --6SsY32fLZILeEXZT-- --===============4814785917605432728== 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 --===============4814785917605432728==--