1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools/testing/selftests/kvm/include
Zhenzhong Duan f53b16ad64 selftests: kvm: Add support for customized slot0 memory size
Until commit 39fe2fc966 ("selftests: kvm: make allocation of extra
memory take effect", 2021-05-27), parameter extra_mem_pages was used
only to calculate the page table size for all the memory chunks,
because real memory allocation happened with calls of
vm_userspace_mem_region_add() after vm_create_default().

Commit 39fe2fc966 however changed the meaning of extra_mem_pages to
the size of memory slot 0.  This makes the memory allocation more
flexible, but makes it harder to account for the number of
pages needed for the page tables.  For example, memslot_perf_test
has a small amount of memory in slot 0 but a lot in other slots,
and adding that memory twice (both in slot 0 and with later
calls to vm_userspace_mem_region_add()) causes an error that
was fixed in commit 000ac42953 ("selftests: kvm: fix overlapping
addresses in memslot_perf_test", 2021-05-29)

Since both uses are sensible, add a new parameter slot0_mem_pages
to vm_create_with_vcpus() and some comments to clarify the meaning of
slot0_mem_pages and extra_mem_pages.  With this change,
memslot_perf_test can go back to passing the number of memory
pages as extra_mem_pages.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Message-Id: <20210608233816.423958-4-zhenzhong.duan@intel.com>
[Squashed in a single patch and rewrote the commit message. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-06-08 13:29:10 -04:00
..
aarch64 kvm: selftests: introduce aarch64_vcpu_add_default 2019-06-05 14:14:45 +02:00
s390x KVM: selftests: sync_regs test for diag318 2020-12-10 13:36:05 +01:00
x86_64 KVM: x86: hyper-v: Make Hyper-V emulation enablement conditional 2021-02-09 08:39:56 -05:00
evmcs.h KVM: selftests: Fix build for evmcs.h 2020-05-06 06:51:36 -04:00
guest_modes.h KVM: selftests: Factor out guest mode code 2021-01-07 18:07:29 -05:00
kvm_util.h selftests: kvm: Add support for customized slot0 memory size 2021-06-08 13:29:10 -04:00
numaif.h KVM: selftests: Add missing header file needed by xAPIC IPI tests 2021-02-11 08:02:08 -05:00
perf_test_util.h KVM: selftests: Add backing src parameter to dirty_log_perf_test 2021-02-04 05:27:19 -05:00
sparsebit.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
test_util.h KVM: selftests: add shared hugetlbfs backing source type 2021-05-27 07:45:57 -04:00