KVM: s390: selftests: add selftest for CMMA migration
authorNico Boehr <nrb@linux.ibm.com>
Fri, 24 Mar 2023 14:54:24 +0000 (15:54 +0100)
committerJanosch Frank <frankja@linux.ibm.com>
Fri, 16 Jun 2023 09:05:31 +0000 (11:05 +0200)
commite325ba2271849e25017743496bcec8d3a83cacb3
tree9af1d4940742e8ae937425de2bd515f483c42d09
parent285cff4c0454340a4dc53f46e67f2cb1c293bd74
KVM: s390: selftests: add selftest for CMMA migration

Add a selftest for CMMA migration on s390.

The tests cover:
- interaction of dirty tracking and migration mode, see my recent patch
  "KVM: s390: disable migration mode when dirty tracking is disabled" [1],
- several invalid calls of KVM_S390_GET_CMMA_BITS, for example: invalid
  flags, CMMA support off, with/without peeking
- ensure KVM_S390_GET_CMMA_BITS initally reports all pages as dirty,
- ensure KVM_S390_GET_CMMA_BITS properly skips over holes in memslots, but
  also non-dirty pages

Note that without the patch at [1] and the small fix in this series, the
selftests will fail.

[1] https://lore.kernel.org/all/20230127140532.230651-2-nrb@linux.ibm.com/

Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-Id: <20230324145424.293889-3-nrb@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
[frankja@linux.ibm.com: squashed
20230606150510.671301-1-nrb@linux.ibm.com / "KVM: s390: selftests:
CMMA: don't run if CMMA not supported"]
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/s390x/cmma_test.c [new file with mode: 0644]