aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib/perf_test_util.c
diff options
context:
space:
mode:
authorSean Christopherson <[email protected]>2021-11-11 00:03:04 +0000
committerPaolo Bonzini <[email protected]>2021-11-16 12:43:26 +0000
commit613d61182fffca6b36ea0df1e44927ccf45b1e9b (patch)
tree01429d88faec181178ca53b8aad79a5bcb0d612e /tools/testing/selftests/kvm/lib/perf_test_util.c
parentKVM: selftests: Use shorthand local var to access struct perf_tests_args (diff)
downloadkernel-613d61182fffca6b36ea0df1e44927ccf45b1e9b.tar.gz
kernel-613d61182fffca6b36ea0df1e44927ccf45b1e9b.zip
KVM: selftests: Capture per-vCPU GPA in perf_test_vcpu_args
Capture the per-vCPU GPA in perf_test_vcpu_args so that tests can get the GPA without having to calculate the GPA on their own. No functional change intended. Signed-off-by: Sean Christopherson <[email protected]> Reviewed-by: Ben Gardon <[email protected]> Signed-off-by: David Matlack <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/perf_test_util.c')
-rw-r--r--tools/testing/selftests/kvm/lib/perf_test_util.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/testing/selftests/kvm/lib/perf_test_util.c b/tools/testing/selftests/kvm/lib/perf_test_util.c
index ccdc950c829e..d9c6bcb7964d 100644
--- a/tools/testing/selftests/kvm/lib/perf_test_util.c
+++ b/tools/testing/selftests/kvm/lib/perf_test_util.c
@@ -136,7 +136,6 @@ void perf_test_setup_vcpus(struct kvm_vm *vm, int vcpus,
bool partition_vcpu_memory_access)
{
struct perf_test_args *pta = &perf_test_args;
- vm_paddr_t vcpu_gpa;
struct perf_test_vcpu_args *vcpu_args;
int vcpu_id;
@@ -149,19 +148,19 @@ void perf_test_setup_vcpus(struct kvm_vm *vm, int vcpus,
(vcpu_id * vcpu_memory_bytes);
vcpu_args->pages = vcpu_memory_bytes /
pta->guest_page_size;
- vcpu_gpa = guest_test_phys_mem +
- (vcpu_id * vcpu_memory_bytes);
+ vcpu_args->gpa = guest_test_phys_mem +
+ (vcpu_id * vcpu_memory_bytes);
} else {
vcpu_args->gva = guest_test_virt_mem;
vcpu_args->pages = (vcpus * vcpu_memory_bytes) /
pta->guest_page_size;
- vcpu_gpa = guest_test_phys_mem;
+ vcpu_args->gpa = guest_test_phys_mem;
}
vcpu_args_set(vm, vcpu_id, 1, vcpu_id);
pr_debug("Added VCPU %d with test mem gpa [%lx, %lx)\n",
- vcpu_id, vcpu_gpa, vcpu_gpa +
+ vcpu_id, vcpu_args->gpa, vcpu_args->gpa +
(vcpu_args->pages * pta->guest_page_size));
}
}