KVM: arm64: selftests: get-reg-list: Split base and pmu registers
authorAndrew Jones <drjones@redhat.com>
Mon, 31 May 2021 10:33:44 +0000 (12:33 +0200)
committerMarc Zyngier <maz@kernel.org>
Tue, 22 Jun 2021 07:51:29 +0000 (08:51 +0100)
commit313673bad871750c0c829def53d037868af75b67
tree7cfec3ed3473b96d33354e086623a6c5ea063cd1
parent32edd2290889d0cd0751dd11853e5a368188066d
KVM: arm64: selftests: get-reg-list: Split base and pmu registers

Since KVM commit 11663111cd49 ("KVM: arm64: Hide PMU registers from
userspace when not available") the get-reg-list* tests have been
failing with

  ...
  ... There are 74 missing registers.
  The following lines are missing registers:
  ...

where the 74 missing registers are all PMU registers. This isn't a
bug in KVM that the selftest found, even though it's true that a
KVM userspace that wasn't setting the KVM_ARM_VCPU_PMU_V3 VCPU
flag, but still expecting the PMU registers to be in the reg-list,
would suddenly no longer have their expectations met. In that case,
the expectations were wrong, though, so that KVM userspace needs to
be fixed, and so does this selftest. The fix for this selftest is to
pull the PMU registers out of the base register sublist into their
own sublist and then create new, pmu-enabled vcpu configs which can
be tested.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210531103344.29325-6-drjones@redhat.com
tools/testing/selftests/kvm/aarch64/get-reg-list.c