From: Fuad Tabba <fuad.tabba@linux.dev>
To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
Mark Brown <broonie@kernel.org>,
Sascha Bischoff <Sascha.Bischoff@arm.com>,
Steffen Eiden <seiden@linux.ibm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Fuad Tabba <tabba@google.com>
Subject: [PATCH v2 00/10] arm64: sysreg: More input checks in the sysreg generator
Date: Fri, 27 Nov 2026 07:44:16 +0000 [thread overview]
Message-ID: <20261127074426.50739-1-fuad.tabba@linux.dev> (raw)
Hi folks,
Changes since v1 [1]:
- Split the TRFCR_ELx.TS change into its own patch. (Steffen)
- Reworded the leading-zero error message. (Steffen)
- Collected tags from Steffen and Mark Brown. (thanks!)
After finding yet another bug in the sysreg file, I think it's time to
stop filling potholes and have the generator reject them instead.
The bug is in MPAM1_EL12. Its Fields line refers to a SysregFields
block that doesn't exist, so its RES0, RES1 and UNKN masks expand to
undefined names. The masks aren't used yet. Patch 1 fixes it.
The rest of the series adds checks to gen-sysreg.awk for input it
accepts while the kernel still builds: a Sysreg and a SysregFields with
the same name (Mark Rutland's suggestion [2]), a Fields or Mapping
target that isn't defined, an enum value not written at its field's
width, a macro defined twice, an encoding that's out of range or has a
leading zero, and a bit position with a leading zero. Three patches
prepare for the checks. One removes a range check that can never fail,
one stops the end-of-file checks from running after an error, and one
drops the leading zeros from the TRFCR_ELx.TS values.
With gawk, mawk and busybox awk, the generated header is the same
before and after the series, apart from the MPAM1_EL12 lines and the
number of digits in the TRFCR_ELx.TS values.
Based on Linux 7.4-rc3 (aebb727447640).
Cheers,
/fuad
[1] https://lore.kernel.org/all/20261123075219.369042-1-fuad.tabba@linux.dev/
[2] https://lore.kernel.org/all/aLF9mSCs1B2gk8BU@J2N7QTR9R3/
Fuad Tabba (10):
arm64: sysreg: Map MPAM1_EL12 to MPAM1_EL1
arm64: sysreg: Remove the dead range check from parse_bitdef()
arm64: sysreg: Reject a Sysreg and a SysregFields with the same name
arm64: sysreg: Don't run the end-of-file checks after an error
arm64: sysreg: Reject a Fields or Mapping line with an undefined
target
arm64: sysreg: Drop the leading zeros from the TRFCR_ELx.TS values
arm64: sysreg: Reject an enum value not written at its field's width
arm64: sysreg: Reject a macro name defined twice
arm64: sysreg: Reject an out-of-range register encoding
arm64: sysreg: Reject a bit position written with a leading zero
arch/arm64/tools/gen-sysreg.awk | 48 ++++++++++++++++++++++++++-------
arch/arm64/tools/sysreg | 16 +++++------
2 files changed, 47 insertions(+), 17 deletions(-)
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
--
2.47.3
next reply other threads:[~2026-11-27 7:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 7:44 Fuad Tabba [this message]
2026-11-27 7:44 ` [PATCH v2 02/10] arm64: sysreg: Remove the dead range check from parse_bitdef() Fuad Tabba
2026-11-27 7:44 ` [PATCH v2 04/10] arm64: sysreg: Don't run the end-of-file checks after an error Fuad Tabba
2026-11-27 7:44 ` [PATCH v2 05/10] arm64: sysreg: Reject a Fields or Mapping line with an undefined target Fuad Tabba
2026-11-27 7:44 ` [PATCH v2 06/10] arm64: sysreg: Drop the leading zeros from the TRFCR_ELx.TS values Fuad Tabba
2026-11-27 7:44 ` [PATCH v2 08/10] arm64: sysreg: Reject a macro name defined twice Fuad Tabba
2026-11-27 7:44 ` [PATCH v2 10/10] arm64: sysreg: Reject a bit position written with a leading zero Fuad Tabba
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=20261127074426.50739-1-fuad.tabba@linux.dev \
--to=fuad.tabba@linux.dev \
--cc=Sascha.Bischoff@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=seiden@linux.ibm.com \
--cc=tabba@google.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