Skip to content

Use TAP in some more x86 KVM selftests

Thomas Huth kvm linux-kselftest lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 12 repliesIn review
  2. v27 patches 2 repliesSuperseded
  3. v14 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- Add patch from Sean to allow setting vCPU's entry points seperately
- Let each test define the entry point via KVM_ONE_VCPU_TEST(), don't do it globally from KVM_ONE_VCPU_TEST_SUITE()

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriatetools/testing/selftests/kvm/x86_64/sync_regs_test.c+5 -50 replies
2/8KVM: selftests: x86: sync_regs_test: Get regs structure before modifying ittools/testing/selftests/kvm/x86_64/sync_regs_test.c+1 -00 replies
3/8KVM: selftests: Move setting a vCPU's entry point to a dedicated APItools/testing/selftests/kvm/include/kvm_util_base.h tools/testing/selftests/kvm/lib/aarch64/processor.c tools/testing/selftests/kvm/lib/riscv/processor.c +2 more+47 -2210 replies
4/8KVM: selftests: Add a macro to define a test with one vcputools/testing/selftests/kvm/include/kvm_test_harness.h+36 -00 replies
5/8KVM: selftests: x86: Use TAP interface in the sync_regs testtools/testing/selftests/kvm/x86_64/sync_regs_test.c+84 -260 replies
6/8KVM: selftests: x86: Use TAP interface in the fix_hypercall testtools/testing/selftests/kvm/x86_64/fix_hypercall_test.c+18 -90 replies
7/8KVM: selftests: x86: Use TAP interface in the vmx_pmu_caps testtools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c+11 -390 replies
8/8KVM: selftests: x86: Use TAP interface in the userspace_msr_exit testtools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c+13 -390 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/8] Use TAP in some more x86 KVM selftests

Basic idea of this series is now to use the kselftest_harness.h framework to get TAP output in the tests, so that it is easier for the user to see what is going on, and e.g. to be able to detect whether a certain test is part of the test binary or not (which is useful when tests get extended in the course of time).

Since most tests also need a vcpu, we introduce our own macros to define such tests, so we don't have to repeat this code all over the place.

v3:
- Add patch from Sean to allow setting vCPU's entry points seperately
- Let each test define the entry point via KVM_ONE_VCPU_TEST(), don't do it globally from KVM_ONE_VCPU_TEST_SUITE()

v2:
- Dropped the "Rename the ASSERT_EQ macro" patch (already merged)
- Split the fixes in the sync_regs_test into separate patches (see the first two patches)
- Introduce the KVM_ONE_VCPU_TEST_SUITE() macro as suggested by Sean (see third patch) and use it in the following patches
- Add a new patch to convert vmx_pmu_caps_test.c, too

Sean Christopherson (1):
KVM: selftests: Move setting a vCPU's entry point to a dedicated API

Thomas Huth (7):
KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate
KVM: selftests: x86: sync_regs_test: Get regs structure before
modifying it
KVM: selftests: Add a macro to define a test with one vcpu
KVM: selftests: x86: Use TAP interface in the sync_regs test
KVM: selftests: x86: Use TAP interface in the fix_hypercall test
KVM: selftests: x86: Use TAP interface in the vmx_pmu_caps test
KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test

 .../selftests/kvm/include/kvm_test_harness.h  |  36 ++++++
 .../selftests/kvm/include/kvm_util_base.h     |  11 +-
 .../selftests/kvm/lib/aarch64/processor.c     |  23 +++-
 .../selftests/kvm/lib/riscv/processor.c       |   9 +-
 .../selftests/kvm/lib/s390x/processor.c       |  13 +-
 .../selftests/kvm/lib/x86_64/processor.c      |  13 +-
 .../selftests/kvm/x86_64/fix_hypercall_test.c |  27 ++--
 .../selftests/kvm/x86_64/sync_regs_test.c     | 121 +++++++++++++-----
 .../kvm/x86_64/userspace_msr_exit_test.c      |  52 ++------
 .../selftests/kvm/x86_64/vmx_pmu_caps_test.c  |  50 ++------
 10 files changed, 215 insertions(+), 140 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/include/kvm_test_harness.h
Signature · 1 line
2.43.0