summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/include/perf_test_util.h
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-02-16 13:38:12 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-11 11:47:20 -0400
commitdf84cef531ca481cbc1dbce84eb13efc6623e4e1 (patch)
treee656506fe5de24adf6c96505c3f37bf8b8797d30 /tools/testing/selftests/kvm/include/perf_test_util.h
parent376851f8953a28be237b0a99adef91f422fa8f19 (diff)
KVM: selftests: Stop conflating vCPU index and ID in perf tests
Track vCPUs by their 'struct kvm_vcpu' object, and stop assuming that a vCPU's ID is the same as its index when referencing a vCPU's metadata. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/perf_test_util.h')
-rw-r--r--tools/testing/selftests/kvm/include/perf_test_util.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/include/perf_test_util.h b/tools/testing/selftests/kvm/include/perf_test_util.h
index d822cb670f1c..eaa88df0555a 100644
--- a/tools/testing/selftests/kvm/include/perf_test_util.h
+++ b/tools/testing/selftests/kvm/include/perf_test_util.h
@@ -25,7 +25,8 @@ struct perf_test_vcpu_args {
uint64_t pages;
/* Only used by the host userspace part of the vCPU thread */
- int vcpu_id;
+ struct kvm_vcpu *vcpu;
+ int vcpu_idx;
};
struct perf_test_args {
@@ -44,7 +45,7 @@ struct perf_test_args {
extern struct perf_test_args perf_test_args;
-struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int vcpus,
+struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int nr_vcpus,
uint64_t vcpu_memory_bytes, int slots,
enum vm_mem_backing_src_type backing_src,
bool partition_vcpu_memory_access);
@@ -57,6 +58,6 @@ void perf_test_join_vcpu_threads(int vcpus);
void perf_test_guest_code(uint32_t vcpu_id);
uint64_t perf_test_nested_pages(int nr_vcpus);
-void perf_test_setup_nested(struct kvm_vm *vm, int nr_vcpus);
+void perf_test_setup_nested(struct kvm_vm *vm, int nr_vcpus, struct kvm_vcpu *vcpus[]);
#endif /* SELFTEST_KVM_PERF_TEST_UTIL_H */