The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/9] arm64: sysreg: More input checks in the sysreg generator
@ 2026-11-23  7:52 Fuad Tabba
  2026-11-23  7:52 ` [PATCH 1/9] arm64: sysreg: Map MPAM1_EL12 to MPAM1_EL1 Fuad Tabba
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Fuad Tabba @ 2026-11-23  7:52 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Mark Rutland, Marc Zyngier, Oliver Upton, Mark Brown,
	Sascha Bischoff, Steffen Eiden, linux-arm-kernel, linux-kernel,
	Fuad Tabba

Hi folks,

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's suggestion [1]), a Fields or Mapping target that
isn't defined, an enum value not written at its field's width, a macro
defined twice, and an encoding or a bit position that's out of range or
has a leading zero. Two patches prepare for them. One removes a range
check that can never fail, and the other stops the end-of-file checks
from running after an error.

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/aLF9mSCs1B2gk8BU@J2N7QTR9R3/

Fuad Tabba (9):
  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: 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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-23  8:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23  7:52 [PATCH 0/9] arm64: sysreg: More input checks in the sysreg generator Fuad Tabba
2026-11-23  7:52 ` [PATCH 1/9] arm64: sysreg: Map MPAM1_EL12 to MPAM1_EL1 Fuad Tabba
2026-11-23  8:47   ` Steffen Eiden
2026-11-23  7:52 ` [PATCH 2/9] arm64: sysreg: Remove the dead range check from parse_bitdef() Fuad Tabba
2026-11-23  8:55   ` Steffen Eiden
2026-11-23  7:52 ` [PATCH 3/9] arm64: sysreg: Reject a Sysreg and a SysregFields with the same name Fuad Tabba
2026-11-23  7:52 ` [PATCH 4/9] arm64: sysreg: Don't run the end-of-file checks after an error Fuad Tabba
2026-11-23  7:52 ` [PATCH 5/9] arm64: sysreg: Reject a Fields or Mapping line with an undefined target Fuad Tabba
2026-11-23  7:52 ` [PATCH 6/9] arm64: sysreg: Reject an enum value not written at its field's width Fuad Tabba
2026-11-23  7:52 ` [PATCH 7/9] arm64: sysreg: Reject a macro name defined twice Fuad Tabba
2026-11-23  7:52 ` [PATCH 8/9] arm64: sysreg: Reject an out-of-range register encoding Fuad Tabba
2026-11-23  7:52 ` [PATCH 9/9] arm64: sysreg: Reject a bit position written with a leading zero Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox