KVM: selftests: Remove duplicate VM in memslot_perf_test
cover KVM: selftests: Remove duplicate VM in memslot_perf_test
PATCH[1] Removes the duplicate VM in memslot_perf_test PATCH[2] Assign guest page size in the sync area in prepare_vm()
Gavin Shan (2):
KVM: selftests: Remove duplicate VM in memslot_perf_test
KVM: selftests: Assign guest page size in sync area early in
memslot_perf_test
tools/testing/selftests/kvm/memslot_perf_test.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
2.23.0
PATCH 1/2 KVM: selftests: Remove duplicate VM in memslot_perf_test
There are two VMs created in prepare_vm(), which isn't necessary. To remove the second created and unnecessary VM.
--- tools/testing/selftests/kvm/memslot_perf_test.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/kvm/memslot_perf_test.c +0 -2
@@ -308,8 +308,6 @@ static bool prepare_vm(struct vm_data *data, int nslots, uint64_t *maxslots, data->hva_slots =malloc (sizeof (*data->hva_slots) * data->nslots);TEST_ASSERT (data->hva_slots,"malloc() fail" ); - data->vm =__vm_create_with_one_vcpu (&data->vcpu, mempages, guest_code); -pr_info_v ("Adding slots 1..%i, each slot with %" PRIu64" pages + %" PRIu64" extra pages last\n" , data->nslots, data->pages_per_slot, rempages);
Signature · 1 line
2.23.0
Quoted 4 lines · Gavin Shan
There are two VMs created in
prepare_vm(), which isn't necessary. To remove the second created and unnecessary VM.Signed-off-by Gavin Shan <[email protected]>
It's weird that we ended with two __vm_create_with_one_vcpu() calls, it looks like the second one was accidentally (re-)introduced during 'kvmarm-6.2' merge, so maybe?:
Anyway, thanks for spotting this:
Thanks,
Maciej
Hi Maciej,
Quoted 6 lines · Maciej S. Szmigiero
Quoted 4 lines · Gavin Shan
There are two VMs created in
prepare_vm(), which isn't necessary. To remove the second created and unnecessary VM.Signed-off-by Gavin Shan <[email protected]>
Quoted 8 lines
It's weird that we ended with two
__vm_create_with_one_vcpu()calls, it looks like the second one was accidentally (re-)introduced during 'kvmarm-6.2' merge, so maybe?:Fixes eb5618911af0 ("Merge tag 'kvmarm-6.2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD")Anyway, thanks for spotting this:
Reviewed-by Maciej S. Szmigiero <[email protected]>
Thanks for your review. Right, it'd better to have the fix tag as your suggested. I think I probably needn't respin. I guess Paolo, Marc or Oliver may help to add the fix tag when it's merged.
Thanks,
Gavin
PATCH 2/2 KVM: selftests: Assign guest page size in sync area early in memslot_perf_test
In reply to Gavin ShanThe 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()).
--- tools/testing/selftests/kvm/memslot_perf_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/kvm/memslot_perf_test.c +1 -2
@@ -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;
Signature · 1 line
2.23.0
Re: [PATCH 2/2] KVM: selftests: Assign guest page size in sync area early in memslot_perf_test
Quoted 6 lines · Gavin Shan
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 <[email protected]>---
Thanks,
Maciej
Sean Christopherson
reviewerQuoted 9 lines · Gavin Shan
PATCH[1] Removes the duplicate VM in
memslot_perf_testPATCH[2] Assign guest page size in the sync area inprepare_vm()Gavin Shan (2):
KVM: selftests: Remove duplicate VM inmemslot_perf_test
KVM: selftests: Assign guest page size in sync area early in
memslot_perf_test[...]
Applied to kvm-x86 selftests, thanks!
[1/2] KVM: selftests: Remove duplicate VM in memslot_perf_test
https://github.com/kvm-x86/linux/commit/e5b426879fc3 [2/2] KVM: selftests: Assign guest page size in sync area early in memslot_perf_test https://github.com/kvm-x86/linux/commit/45f679550d72
--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes