linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] arm64: sysreg: Fix sysreg field definitions and generation script
@ 2025-08-29  9:51 Fuad Tabba
  2025-08-29  9:51 ` [PATCH v3 1/3] arm64: sysreg: Fix and tidy up sysreg field definitions Fuad Tabba
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fuad Tabba @ 2025-08-29  9:51 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel
  Cc: maz, oliver.upton, will, joey.gouly, suzuki.poulose, yuzenghui,
	catalin.marinas, vdonnefort, qperret, sebastianene, keirf,
	smostafa, tabba

The sysreg definitions file has a few errors. In Enum Security,
NSACR_RFR is set to 0b0001 instead of the spec value of 0b0010.
Additionaly, the sign of the Enums DoubleLock and EIESB are wrong
(should be Signed and Unsigned, respectively).

Moreover, the file has some redundant definitions, e.g.,
RCWSMASK_EL1. While these redundant definitions are not wrong per se,
they add unnecessary code into the generated header file and could be a
source of future bugs.

Fix the Enums and remove the redundant Sysreg definitions.

To reduce the chance of this happening in the future, add validation to
the sysreg header generation script. I didn't want to go overboard with
validation, so I only added validation that would catch most of the
errors that I've seen, which also are errors that wouldn't generate a
build error later on.

Changes since v2 [1]:
- Added patch that fixes field sign definitions for DoubleLock and EIESB
- Removed whitespace fixes from first patch, since there are more
  inconsistent whitespace use in the file, and fixing it all would lead
  to too much churn.
- Collected Reviews/Acks
- Rebased on 6.17-rc3

Cheers,
/fuad

[1] https://lore.kernel.org/all/20250813164506.1203851-1-tabba@google.com/

Fuad Tabba (3):
  arm64: sysreg: Fix and tidy up sysreg field definitions
  arm64: sysreg: Correct sign definitions for EIESB and DoubleLock
  arm64: sysreg: Add validation checks to sysreg header generation
    script

 arch/arm64/tools/gen-sysreg.awk | 20 ++++++++++++++++++++
 arch/arm64/tools/sysreg         | 18 +++++-------------
 2 files changed, 25 insertions(+), 13 deletions(-)


base-commit: 1b237f190eb3d36f52dffe07a40b5eb210280e00
-- 
2.51.0.338.gd7d06c2dae-goog



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

end of thread, other threads:[~2025-08-29 14:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29  9:51 [PATCH v3 0/3] arm64: sysreg: Fix sysreg field definitions and generation script Fuad Tabba
2025-08-29  9:51 ` [PATCH v3 1/3] arm64: sysreg: Fix and tidy up sysreg field definitions Fuad Tabba
2025-08-29 10:07   ` Mark Rutland
2025-08-29  9:51 ` [PATCH v3 2/3] arm64: sysreg: Correct sign definitions for EIESB and DoubleLock Fuad Tabba
2025-08-29 10:10   ` Mark Rutland
2025-08-29  9:51 ` [PATCH v3 3/3] arm64: sysreg: Add validation checks to sysreg header generation script Fuad Tabba
2025-08-29 10:14   ` Mark Rutland

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).