All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] KVM: arm64: selftests: Fix get-reg-list
@ 2021-05-31 10:33 ` Andrew Jones
  0 siblings, 0 replies; 32+ messages in thread
From: Andrew Jones @ 2021-05-31 10:33 UTC (permalink / raw)
  To: kvm, kvmarm; +Cc: maz, ricarkol, eric.auger, alexandru.elisei, pbonzini

v3:
 - Took Ricardo's suggestions in order to avoid needing to update
   prepare_vcpu_init, finalize_vcpu, and check_supported when adding
   new register sublists by better associating the sublists with their
   vcpu feature bits and caps [Ricardo]
 - We now dynamically generate the vcpu config name by creating them
   from its sublist names [drew]

v2:
 - Removed some cruft left over from a previous more complex design of the
   config command line parser
 - Dropped the list printing factor out patch as it's not necessary
 - Added a 'PASS' output for passing tests to allow testers to feel good
 - Changed the "up to date with kernel" comment to reference 5.13.0-rc2


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.

We could fix the test with a one-liner since we just need a

  init->features[0] |= 1 << KVM_ARM_VCPU_PMU_V3;

in prepare_vcpu_init(), but that's too easy, so here's a 5 patch patch
series instead :-)  The reason for all the patches and the heavy diffstat
is to prepare for other vcpu configuration testing, e.g. ptrauth and mte.
With the refactoring done in this series, we should now be able to easily
add register sublists and vcpu configs to the get-reg-list test, as the
last patch demonstrates with the pmu fix.

Thanks,
drew


Andrew Jones (5):
  KVM: arm64: selftests: get-reg-list: Introduce vcpu configs
  KVM: arm64: selftests: get-reg-list: Prepare to run multiple configs
    at once
  KVM: arm64: selftests: get-reg-list: Provide config selection option
  KVM: arm64: selftests: get-reg-list: Remove get-reg-list-sve
  KVM: arm64: selftests: get-reg-list: Split base and pmu registers

 tools/testing/selftests/kvm/.gitignore        |   1 -
 tools/testing/selftests/kvm/Makefile          |   1 -
 .../selftests/kvm/aarch64/get-reg-list-sve.c  |   3 -
 .../selftests/kvm/aarch64/get-reg-list.c      | 439 +++++++++++++-----
 4 files changed, 321 insertions(+), 123 deletions(-)
 delete mode 100644 tools/testing/selftests/kvm/aarch64/get-reg-list-sve.c

-- 
2.31.1


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2021-06-22  7:57 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 10:33 [PATCH v3 0/5] KVM: arm64: selftests: Fix get-reg-list Andrew Jones
2021-05-31 10:33 ` Andrew Jones
2021-05-31 10:33 ` [PATCH v3 1/5] KVM: arm64: selftests: get-reg-list: Introduce vcpu configs Andrew Jones
2021-05-31 10:33   ` Andrew Jones
2021-06-02 23:40   ` Ricardo Koller
2021-06-02 23:40     ` Ricardo Koller
2021-06-03 12:14     ` Andrew Jones
2021-06-03 12:14       ` Andrew Jones
2021-05-31 10:33 ` [PATCH v3 2/5] KVM: arm64: selftests: get-reg-list: Prepare to run multiple configs at once Andrew Jones
2021-05-31 10:33   ` Andrew Jones
2021-06-02 23:56   ` Ricardo Koller
2021-06-02 23:56     ` Ricardo Koller
2021-05-31 10:33 ` [PATCH v3 3/5] KVM: arm64: selftests: get-reg-list: Provide config selection option Andrew Jones
2021-05-31 10:33   ` Andrew Jones
2021-06-03  0:03   ` Ricardo Koller
2021-06-03  0:03     ` Ricardo Koller
2021-05-31 10:33 ` [PATCH v3 4/5] KVM: arm64: selftests: get-reg-list: Remove get-reg-list-sve Andrew Jones
2021-05-31 10:33   ` Andrew Jones
2021-06-03  0:09   ` Ricardo Koller
2021-06-03  0:09     ` Ricardo Koller
2021-05-31 10:33 ` [PATCH v3 5/5] KVM: arm64: selftests: get-reg-list: Split base and pmu registers Andrew Jones
2021-05-31 10:33   ` Andrew Jones
2021-06-02 23:26   ` Ricardo Koller
2021-06-02 23:26     ` Ricardo Koller
2021-06-22  7:07 ` [PATCH v3 0/5] KVM: arm64: selftests: Fix get-reg-list Andrew Jones
2021-06-22  7:07   ` Andrew Jones
2021-06-22  7:32   ` Marc Zyngier
2021-06-22  7:32     ` Marc Zyngier
2021-06-22  7:48     ` Andrew Jones
2021-06-22  7:48       ` Andrew Jones
2021-06-22  7:57 ` Marc Zyngier
2021-06-22  7:57   ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.