lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250115134259.1864060-6-james.clark@linaro.org>
Date: Wed, 15 Jan 2025 13:42:57 +0000
From: James Clark <james.clark@...aro.org>
To: linux-arm-kernel@...ts.infradead.org,
	robh@...nel.org,
	broonie@...nel.org,
	maz@...nel.org
Cc: James Clark <james.clark@...aro.org>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Oliver Upton <oliver.upton@...ux.dev>,
	Anshuman Khandual <anshuman.khandual@....com>,
	James Morse <james.morse@....com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 5/5] arm64/sysreg: Enforce sorting

Make an unsorted sysreg file a build error so it stays sorted.

Signed-off-by: James Clark <james.clark@...aro.org>
---
 arch/arm64/tools/gen-sysreg.awk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk
index 7f578216dc68..00a8391f373d 100755
--- a/arch/arm64/tools/gen-sysreg.awk
+++ b/arch/arm64/tools/gen-sysreg.awk
@@ -98,6 +98,7 @@ BEGIN {
 
 	__current_block_depth = 0
 	__current_block[__current_block_depth] = "Root"
+	__last_sysreg_sort_val = 0
 }
 
 END {
@@ -156,6 +157,12 @@ $1 == "Sysreg" && block_current() == "Root" {
 	crm = $6
 	op2 = $7
 
+	sort_val = sprintf("%02d", $3) sprintf("%02d", $4) sprintf("%02d", $5) \
+			sprintf("%02d", $6) sprintf("%02d", $7)
+	if (sort_val < __last_sysreg_sort_val)
+		fatal($2 ": Sysregs should be sorted by encoding")
+	__last_sysreg_sort_val = sort_val
+
 	res0 = "UL(0)"
 	res1 = "UL(0)"
 	unkn = "UL(0)"
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ