linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] kvm selftests and MAX_VCPU_ID
@ 2021-04-12 22:26 Fabiano Rosas
  2021-04-12 22:26 ` [RFC PATCH 1/2] KVM: selftests: Add max vcpus test for ppc64le Fabiano Rosas
  2021-04-12 22:26 ` [RFC PATCH 2/2] KVM: PPC: Book3S HV: Provide a more accurate MAX_VCPU_ID in P9 Fabiano Rosas
  0 siblings, 2 replies; 5+ messages in thread
From: Fabiano Rosas @ 2021-04-12 22:26 UTC (permalink / raw)
  To: kvm-ppc; +Cc: linuxppc-dev, groug, david

I've been experimenting with the kvm selftests to see if I can enable
them for powerpc and get some useful coverage going.

This series is just the initial boilerplate to get the simplest of the
tests to run. The test is arch agnostic and is already in the tree. It
just tries to start a vm with the maximum number of vcpus. It fails on
a P9:

$ cd tools/selftests/kvm
$ make ARCH=powerpc
$ ulimit -n
4096
$ ./kvm_create_max_vcpus
KVM_CAP_MAX_VCPU_ID: 16384
KVM_CAP_MAX_VCPUS: 2048
Testing creating 2048 vCPUs, with IDs 0...2047.
Testing creating 2048 vCPUs, with IDs 14336...16383.
==== Test Assertion Failure ====
  lib/kvm_util.c:983: vcpu->fd >= 0
  pid=74066 tid=74066 - Invalid argument
     1  0x0000000010002813: vm_vcpu_add at kvm_util.c:982
     2  0x000000001000176f: test_vcpu_creation at kvm_create_max_vcpus.c:34 (discriminator 3)
     3  0x00000000100014e7: main at kvm_create_max_vcpus.c:62
     4  0x00007fff89454077: ?? ??:0
     5  0x00007fff89454263: ?? ??:0
  KVM_CREATE_VCPU failed, rc: -1 errno: 22

The second patch is my attempt at improving the situation which,
admittedly, is mostly harmless, caused by the fact that
KVM_MAX_VCPU_IDS is set to a large value that is not always supported
by P9 so KVM HV aborts with -EINVAL.

I intended to get this first patch/test to work before implementing
the rest of the selftest infrastructure and adding more tests so I
thought it would be best to get some feedback before I delve in too
deep.

Fabiano Rosas (2):
  KVM: selftests: Add max vcpus test for ppc64le
  KVM: PPC: Book3S HV: Provide a more accurate MAX_VCPU_ID in P9

 arch/powerpc/kvm/powerpc.c                    |  5 ++-
 tools/testing/selftests/kvm/Makefile          |  7 +++
 .../testing/selftests/kvm/include/kvm_util.h  |  7 +++
 .../selftests/kvm/include/powerpc/processor.h |  7 +++
 tools/testing/selftests/kvm/lib/kvm_util.c    |  5 +++
 .../selftests/kvm/lib/powerpc/processor.c     | 44 +++++++++++++++++++
 6 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/kvm/include/powerpc/processor.h
 create mode 100644 tools/testing/selftests/kvm/lib/powerpc/processor.c

--
2.29.2

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

end of thread, other threads:[~2022-03-08 14:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 22:26 [RFC PATCH 0/2] kvm selftests and MAX_VCPU_ID Fabiano Rosas
2021-04-12 22:26 ` [RFC PATCH 1/2] KVM: selftests: Add max vcpus test for ppc64le Fabiano Rosas
2021-04-12 22:26 ` [RFC PATCH 2/2] KVM: PPC: Book3S HV: Provide a more accurate MAX_VCPU_ID in P9 Fabiano Rosas
2022-03-08 13:34   ` Christophe Leroy
2022-03-08 14:27     ` Fabiano Rosas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).