From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Marc Zyngier <maz@kernel.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 00/12] arm64: Automatic system register definition generation
Date: Tue, 3 May 2022 12:28:50 +0100 [thread overview]
Message-ID: <YnER8hY/UG9MHs3X@arm.com> (raw)
In-Reply-To: <20220426181704.2583494-1-broonie@kernel.org>
On Tue, Apr 26, 2022 at 07:16:52PM +0100, Mark Brown wrote:
> This patch series introduces a
> script which describes registers and the fields within them in a format
> that is easy to cross reference with the architecture reference manual
> and uses them to generate the constants we use in a standard format:
>
> | #define REG_ID_AA64ISAR0_EL1 S3_0_C0_C6_0
> | #define SYS_ID_AA64ISAR0_EL1 sys_reg(3, 0, 0, 6, 0)
> | #define SYS_ID_AA64ISAR0_EL1_Op0 3
> | #define SYS_ID_AA64ISAR0_EL1_Op1 0
> | #define SYS_ID_AA64ISAR0_EL1_CRn 0
> | #define SYS_ID_AA64ISAR0_EL1_CRm 6
> | #define SYS_ID_AA64ISAR0_EL1_Op2 0
>
> | #define ID_AA64ISAR0_EL1_RNDR GENMASK(63, 60)
> | #define ID_AA64ISAR0_EL1_RNDR_MASK GENMASK(63, 60)
> | #define ID_AA64ISAR0_EL1_RNDR_SHIFT 60
> | #define ID_AA64ISAR0_EL1_RNDR_WIDTH 4
> | #define ID_AA64ISAR0_EL1_RNDR_NI UL(0b0000)
> | #define ID_AA64ISAR0_EL1_RNDR_IMP UL(0b0001)
I like the automatic generation of the register fields, I think it's
less prone to errors and it gives us consistent notation, so it would be
nice to have this in mainline.
I'm not convinced that we need the RES[01]_msb_lsb definitions, I'd
rather have a RES[01] with all the UL(x) or'ed in. We want to avoid
anyone making use of the RES1_x explicitly, though most likely we'd
notice this during review. But these are some 'constants' that will keep
changing even their macro name, not just the value (when one bit from
the field gets used for something else).
> At the moment this is only intended to express metadata from the
> architecture, and does not handle policy imposed by the kernel, such as
> values exposed to userspace or VMs. In future this could be extended to
> express such information. This could also be extended to cover more
> information such as the FTR_SIGNED/FTR_UNSIGNED distinction.
We could indeed add signed info for the enum fields at some point. As
for kernel possible like FTR_VISIBLE, not sure whether we should add
them to the same sysreg file. My instinct is to keep it strictly about
the architecture definitions, not kernel policy.
> Rather than attempting to convert every register at once the current
> series converts a few sample registers to provide some concrete examples
> but allow for easier updating during review of the file format and the
> script. Handling a register at a time should also make review less
> taxing so it seems like a sensible approach in general.
So apart from RES definitions (but happy to hear an argument), I'm fine
with the patches. If you think they are ready, we could queue the
infrastructure for 5.19 and add some of the register definitions at -rc1
to avoid conflicts (the more conversions the better).
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-05-03 11:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 18:16 [PATCH v5 00/12] arm64: Automatic system register definition generation Mark Brown
2022-04-26 18:16 ` [PATCH v5 01/12] arm64/sysreg: Introduce helpers for access to sysreg fields Mark Brown
2022-04-26 18:16 ` [PATCH v5 02/12] arm64/mte: Make TCF0 naming and field values more standard Mark Brown
2022-04-26 18:16 ` [PATCH v5 03/12] arm64/mte: Make TCF field values and naming " Mark Brown
2022-04-26 18:16 ` [PATCH v5 04/12] arm64/sysreg: Rename SCTLR_EL1_NTWE/TWI to SCTLR_EL1_nTWE/TWI Mark Brown
2022-04-26 18:16 ` [PATCH v5 05/12] arm64/sysreg: Define bits for previously RES1 fields in SCTLR_EL1 Mark Brown
2022-04-26 18:16 ` [PATCH v5 06/12] arm64: Update name of ID_AA64ISAR0_EL1_ATOMIC to reflect ARM Mark Brown
2022-04-28 13:31 ` Mark Rutland
2022-04-26 18:16 ` [PATCH v5 07/12] arm64/sysreg: Standardise ID_AA64ISAR0_EL1 macro names Mark Brown
2022-04-26 18:17 ` [PATCH v5 08/12] arm64: Add sysreg header generation scripting Mark Brown
2022-04-26 18:17 ` [PATCH v5 09/12] arm64/sysreg: Enable automatic generation of system register definitions Mark Brown
2022-04-26 18:17 ` [PATCH v5 10/12] arm64/sysreg: Generate definitions for ID_AA64ISAR0_EL1 Mark Brown
2022-04-26 18:17 ` [PATCH v5 11/12] arm64/sysreg: Generate definitions for TTBRn_EL1 Mark Brown
2022-04-26 18:17 ` [PATCH v5 12/12] arm64/sysreg: Generate definitions for SCTLR_EL1 Mark Brown
2022-05-03 11:28 ` Catalin Marinas [this message]
2022-05-03 12:58 ` [PATCH v5 00/12] arm64: Automatic system register definition generation Mark Rutland
2022-05-03 16:32 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YnER8hY/UG9MHs3X@arm.com \
--to=catalin.marinas@arm.com \
--cc=broonie@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).