diff options
author | 2022-05-03 09:52:48 -0700 | |
---|---|---|
committer | 2022-06-11 11:47:26 -0400 | |
commit | 6e1d13bf3815d6058620dd72135be292d9f44bc9 (patch) | |
tree | aaf37b045a398cb40af79098d94862a983516d36 /tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c | |
parent | KVM: selftests: Drop @num_percpu_pages from __vm_create_with_vcpus() (diff) | |
download | wireguard-linux-6e1d13bf3815d6058620dd72135be292d9f44bc9.tar.xz wireguard-linux-6e1d13bf3815d6058620dd72135be292d9f44bc9.zip |
KVM: selftests: Move per-VM/per-vCPU nr pages calculation to __vm_create()
Handle all memslot0 size adjustments in __vm_create(). Currently, the
adjustments reside in __vm_create_with_vcpus(), which means tests that
call vm_create() or __vm_create() directly are left to their own devices.
Some tests just pass DEFAULT_GUEST_PHY_PAGES and don't bother with any
adjustments, while others mimic the per-vCPU calculations.
For vm_create(), and thus __vm_create(), take the number of vCPUs that
will be runnable to calculate that number of per-vCPU pages needed for
memslot0. To give readers a hint that neither vm_create() nor
__vm_create() create vCPUs, name the parameter @nr_runnable_vcpus instead
of @nr_vcpus. That also gives readers a hint as to why tests that create
larger numbers of vCPUs but never actually run those vCPUs can skip
straight to the vm_create_barebones() variant.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c b/tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c index e416af887ca0..4a962952212e 100644 --- a/tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c +++ b/tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) exit(KSFT_SKIP); } - vm = vm_create(DEFAULT_GUEST_PHY_PAGES + DEFAULT_STACK_PGS * NR_TEST_VCPUS); + vm = vm_create(NR_TEST_VCPUS); vm_ioctl(vm, KVM_SET_TSC_KHZ, (void *) TEST_TSC_KHZ); pthread_spin_init(&create_lock, PTHREAD_PROCESS_PRIVATE); |