KVM: selftests: memslot_perf_test: Consolidate memory
authorGavin Shan <gshan@redhat.com>
Thu, 20 Oct 2022 07:12:08 +0000 (15:12 +0800)
committerMarc Zyngier <maz@kernel.org>
Thu, 10 Nov 2022 18:56:15 +0000 (18:56 +0000)
commit88a64e65484ef6b5cb09fe545d0dd00c950a1131
treef68dbf7d41a3ff106f14fe1169c036007f27fb67
parent8675c6f226986ddb67752be22279a0e2385b197e
KVM: selftests: memslot_perf_test: Consolidate memory

The addresses and sizes passed to vm_userspace_mem_region_add() and
madvise() should be aligned to host page size, which can be 64KB on
aarch64. So it's wrong by passing additional fixed 4KB memory area
to various tests.

Fix it by passing additional fixed 64KB memory area to various tests.
We also add checks to ensure that none of host/guest page size exceeds
64KB. MEM_TEST_MOVE_SIZE is fixed up to 192KB either.

With this, the following command works fine on 64KB-page-size-host and
4KB-page-size-guest.

  # ./memslot_perf_test -v -s 512

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221020071209.559062-6-gshan@redhat.com
tools/testing/selftests/kvm/memslot_perf_test.c