mbox series

[v2,0/3] KVM: selftests: arm64: Make use of sysreg defintions in get-reg-list

Message ID 20240806-kvm-arm64-get-reg-list-v2-0-1d3fbc7b6844@kernel.org (mailing list archive)
Headers show
Series KVM: selftests: arm64: Make use of sysreg defintions in get-reg-list | expand

Message

Mark Brown Aug. 6, 2024, 2:24 p.m. UTC
The system register definitions in the arm64 get-reg-list are all done
with directly specified magic numbers rather than using the definitions
we import from the main kernel.  This is error prone, and requires us to
audit the additions to get-reg-list separately to what we do when
specifying the registers for the main kernel.  Since Marc has indicated
that this isn't a deliberate or desired choice let's start using the
constants we have defined.

We first manually update the data used to filter registers based on ID
register fields to use a simplified macro that specifies the register
and ID field in a muc more compact fashion.  This is done first since
there is an error in the ID register field for the S1PIE registers.  We
then replace all the remaining named system register specifications with
use of the existing KVM_ARM64_SYS_REG() macro.

This is just a first step, there's a bunch more work we could be doing
here, the main thing being making use of the encodings in
arch/arm64/tools/sysreg to convert more of the registers (including
updating as more registers are converted to use the generator).

Signed-off-by: Mark Brown <broonie@kernel.org>
---
Changes in v2:
- Add use of designated initalisers when converting filtering macros.
- Manual handling of CNTV_CTL_EL0 and CNTV_CVAL_EL0.
- Commit message tweaks.
- Link to v1: https://lore.kernel.org/r/20240802-kvm-arm64-get-reg-list-v1-0-3a5bf8f80765@kernel.org

---
Mark Brown (3):
      KVM: selftests: arm64: Simplify specification of filtered registers
      KVM: selftests: arm64: Use symbolic definitions for incorrect encodings
      KVM: selftests: arm64: Use generated defines for named system registers

 tools/testing/selftests/kvm/aarch64/get-reg-list.c | 244 ++++++++++-----------
 1 file changed, 122 insertions(+), 122 deletions(-)
---
base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b
change-id: 20240802-kvm-arm64-get-reg-list-a86a37460bdd

Best regards,