Message ID | 20230118092133.320003-3-gshan@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: selftests: Remove duplicate VM in memslot_perf_test | expand |
On 18.01.2023 10:21, Gavin Shan wrote: > The guest page size in the synchronization area is needed by all test > cases. So it's reasonable to set it in the unified preparation function > (prepare_vm()). > > Signed-off-by: Gavin Shan <gshan@redhat.com> > --- Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> Thanks, Maciej
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c index adbbcca3e354..4210cd21d159 100644 --- a/tools/testing/selftests/kvm/memslot_perf_test.c +++ b/tools/testing/selftests/kvm/memslot_perf_test.c @@ -347,6 +347,7 @@ static bool prepare_vm(struct vm_data *data, int nslots, uint64_t *maxslots, virt_map(data->vm, MEM_GPA, MEM_GPA, data->npages); sync = (typeof(sync))vm_gpa2hva(data, MEM_SYNC_GPA, NULL); + sync->guest_page_size = data->vm->page_size; atomic_init(&sync->start_flag, false); atomic_init(&sync->exit_flag, false); atomic_init(&sync->sync_flag, false); @@ -808,8 +809,6 @@ static bool test_execute(int nslots, uint64_t *maxslots, } sync = (typeof(sync))vm_gpa2hva(data, MEM_SYNC_GPA, NULL); - - sync->guest_page_size = data->vm->page_size; if (tdata->prepare && !tdata->prepare(data, sync, maxslots)) { ret = false;
The guest page size in the synchronization area is needed by all test cases. So it's reasonable to set it in the unified preparation function (prepare_vm()). Signed-off-by: Gavin Shan <gshan@redhat.com> --- tools/testing/selftests/kvm/memslot_perf_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)