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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240806-7d137744fa04e05689efac71@orel>
Date: Tue, 6 Aug 2024 10:03:20 +0200
From: Andrew Jones <andrew.jones@...ux.dev>
To: Mark Brown <broonie@...nel.org>
Cc: Marc Zyngier <maz@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>, 
	James Morse <james.morse@....com>, Suzuki K Poulose <suzuki.poulose@....com>, 
	Paolo Bonzini <pbonzini@...hat.com>, Shuah Khan <shuah@...nel.org>, 
	Catalin Marinas <catalin.marinas@....com>, Joey Gouly <joey.gouly@....com>, 
	linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev, kvm@...r.kernel.org, 
	linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] KVM: selftests: arm64: Use generated defines for
 named system registers

On Fri, Aug 02, 2024 at 10:57:54PM GMT, Mark Brown wrote:
> Currently the get-reg-list test uses directly specified numeric values to
> define system registers to validate. Since we already have a macro which
> allows us to use the generated system register definitions from the main
> kernel easily let's update all the registers where we have specified the
> name in a comment to just use that macro. This reduces the number of
> places where we need to validate the name to number mapping.
> 
> This conversion was done with the sed command:
> 
>   sed -i -E 's-ARM64_SYS_REG.*/\* (.*) \*/-KVM_ARM64_SYS_REG(SYS_\1),-' tools/testing/selftests/kvm/aarch64/get-reg-list.c
> 
> We still have a number of numerically specified registers, some of these
> are reserved registers without defined names (eg, unallocated ID registers)
> and others don't have kernel macro definitions yet.

FWIW, the "ARM64_SYS_REG(...encoding...), /* NAME */" format was
intentional. The idea was that when get-reg-list outputs new or missing
registers it discovers, or the user lists registers with --list, the best
it can do is output "ARM64_SYS_REG(...encoding...)". Putting that format
directly into the test enabled copy+paste of the list output into a test
case. However, the lack of names did lead to scripting the generation of
the name comments, which means it wasn't a direct copy+paste anyway. The
other benefit of the format was being able to directly grep the test for
the 'missing' registers. Anyway, maybe always going through asm/sysreg.h
with greps of '...encoding...' is the better approach.

Thanks,
drew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ