[PATCH v2 2/2] arm64: sysreg: Add validation checks to sysreg header generation script

Marc Zyngier maz at kernel.org
Thu Aug 14 00:16:03 PDT 2025


On Wed, 13 Aug 2025 17:45:06 +0100,
Fuad Tabba <tabba at google.com> wrote:
> 
> The gen_sysreg.awk script processes the system register specification in
> the sysreg text file to generate C macro definitions. The current script
> will silently accept certain errors in the specification file, leading
> to incorrect header generation.
> 
> For example, a Sysreg or SysregFields can be accidentally duplicated,
> causing its macros to be emitted twice. Or an Enum can contain duplicate
> values for different items, which is architecturally incorrect.
> 
> Add checks to catch these errors at build time. The script now tracks
> all seen Sysreg and SysregFields definitions and checks for duplicates.
> It also tracks values within each Enum block to ensure entries are
> unique.
> 
> Signed-off-by: Fuad Tabba <tabba at google.com>

Thanks for adding these checks, most useful.

Acked-by: Marc Zyngier <maz at kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list