]> Gentwo Git Trees - linux/.git/commit
KVM: arm64: selftests: Remove a duplicate register listing in set_id_regs
authorMark Brown <broonie@kernel.org>
Sat, 20 Sep 2025 19:51:59 +0000 (20:51 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 24 Sep 2025 18:24:57 +0000 (19:24 +0100)
commit5a070fc376babc7efdc8288b97431e43e18f4646
tree4f6d3604ea52b2d2a1de6af303c38960332cc552
parent75b2fdc1a82195997cab4836f9e511cbe8c8eb52
KVM: arm64: selftests: Remove a duplicate register listing in set_id_regs

Currently we list the main set of registers with bits we test three
times, once in the test_regs array which is used at runtime, once in the
guest code and once in a list of ARRAY_SIZE() operations we use to tell
kselftest how many tests we plan to execute. This is needlessly fiddly,
when adding new registers as the test_cnt calculation is formatted with
two registers per line. Instead count the number of bitfields in the
register arrays at runtime.

The existing code subtracts ARRAY_SIZE(test_regs) from the number of
tests to account for the terminating FTR_REG_END entries in the per
register arrays, the new code accounts for this when enumerating.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
tools/testing/selftests/kvm/arm64/set_id_regs.c