All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: selftests: Remove duplicate VM in memslot_perf_test
@ 2023-01-18  9:21 Gavin Shan
  2023-01-18  9:21 ` [PATCH 1/2] " Gavin Shan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gavin Shan @ 2023-01-18  9:21 UTC (permalink / raw)
  To: kvmarm
  Cc: kvmarm, kvm, pbonzini, shuah, maz, oliver.upton,
	maciej.szmigiero, seanjc, shan.gavin

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(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] KVM: selftests: Remove duplicate VM in memslot_perf_test
  2023-01-18  9:21 [PATCH 0/2] KVM: selftests: Remove duplicate VM in memslot_perf_test Gavin Shan
@ 2023-01-18  9:21 ` Gavin Shan
  2023-01-23 23:56   ` Maciej S. Szmigiero
  2023-01-18  9:21 ` [PATCH 2/2] KVM: selftests: Assign guest page size in sync area early " Gavin Shan
  2023-02-08  2:07 ` [PATCH 0/2] KVM: selftests: Remove duplicate VM " Sean Christopherson
  2 siblings, 1 reply; 7+ messages in thread
From: Gavin Shan @ 2023-01-18  9:21 UTC (permalink / raw)
  To: kvmarm
  Cc: kvmarm, kvm, pbonzini, shuah, maz, oliver.upton,
	maciej.szmigiero, seanjc, shan.gavin

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 <gshan@redhat.com>
---
 tools/testing/selftests/kvm/memslot_perf_test.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e6587e193490..adbbcca3e354 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -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);
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] KVM: selftests: Assign guest page size in sync area early in memslot_perf_test
  2023-01-18  9:21 [PATCH 0/2] KVM: selftests: Remove duplicate VM in memslot_perf_test Gavin Shan
  2023-01-18  9:21 ` [PATCH 1/2] " Gavin Shan
@ 2023-01-18  9:21 ` Gavin Shan
  2023-01-23 23:57   ` Maciej S. Szmigiero
  2023-02-08  2:07 ` [PATCH 0/2] KVM: selftests: Remove duplicate VM " Sean Christopherson
  2 siblings, 1 reply; 7+ messages in thread
From: Gavin Shan @ 2023-01-18  9:21 UTC (permalink / raw)
  To: kvmarm
  Cc: kvmarm, kvm, pbonzini, shuah, maz, oliver.upton,
	maciej.szmigiero, seanjc, shan.gavin

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(-)

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;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] KVM: selftests: Remove duplicate VM in memslot_perf_test
  2023-01-18  9:21 ` [PATCH 1/2] " Gavin Shan
@ 2023-01-23 23:56   ` Maciej S. Szmigiero
  2023-01-27  0:08     ` Gavin Shan
  0 siblings, 1 reply; 7+ messages in thread
From: Maciej S. Szmigiero @ 2023-01-23 23:56 UTC (permalink / raw)
  To: Gavin Shan
  Cc: kvmarm, kvmarm, kvm, pbonzini, shuah, maz, oliver.upton, seanjc,
	shan.gavin

On 18.01.2023 10:21, Gavin Shan wrote:
> 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 <gshan@redhat.com>

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 <maciej.szmigiero@oracle.com>

Thanks,
Maciej


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] KVM: selftests: Assign guest page size in sync area early in memslot_perf_test
  2023-01-18  9:21 ` [PATCH 2/2] KVM: selftests: Assign guest page size in sync area early " Gavin Shan
@ 2023-01-23 23:57   ` Maciej S. Szmigiero
  0 siblings, 0 replies; 7+ messages in thread
From: Maciej S. Szmigiero @ 2023-01-23 23:57 UTC (permalink / raw)
  To: Gavin Shan
  Cc: kvmarm, kvmarm, kvm, pbonzini, shuah, maz, oliver.upton, seanjc,
	shan.gavin

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] KVM: selftests: Remove duplicate VM in memslot_perf_test
  2023-01-23 23:56   ` Maciej S. Szmigiero
@ 2023-01-27  0:08     ` Gavin Shan
  0 siblings, 0 replies; 7+ messages in thread
From: Gavin Shan @ 2023-01-27  0:08 UTC (permalink / raw)
  To: Maciej S. Szmigiero
  Cc: kvmarm, kvmarm, kvm, pbonzini, shuah, maz, oliver.upton, seanjc,
	shan.gavin

Hi Maciej,

On 1/24/23 10:56 AM, Maciej S. Szmigiero wrote:
> On 18.01.2023 10:21, Gavin Shan wrote:
>> 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 <gshan@redhat.com>
> 
> 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 <maciej.szmigiero@oracle.com>
> 

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] KVM: selftests: Remove duplicate VM in memslot_perf_test
  2023-01-18  9:21 [PATCH 0/2] KVM: selftests: Remove duplicate VM in memslot_perf_test Gavin Shan
  2023-01-18  9:21 ` [PATCH 1/2] " Gavin Shan
  2023-01-18  9:21 ` [PATCH 2/2] KVM: selftests: Assign guest page size in sync area early " Gavin Shan
@ 2023-02-08  2:07 ` Sean Christopherson
  2 siblings, 0 replies; 7+ messages in thread
From: Sean Christopherson @ 2023-02-08  2:07 UTC (permalink / raw)
  To: Sean Christopherson, kvmarm, Gavin Shan
  Cc: kvmarm, kvm, pbonzini, shuah, maz, oliver.upton,
	maciej.szmigiero, shan.gavin

On Wed, 18 Jan 2023 17:21:31 +0800, Gavin Shan wrote:
> 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
> 
> [...]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-08  2:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18  9:21 [PATCH 0/2] KVM: selftests: Remove duplicate VM in memslot_perf_test Gavin Shan
2023-01-18  9:21 ` [PATCH 1/2] " Gavin Shan
2023-01-23 23:56   ` Maciej S. Szmigiero
2023-01-27  0:08     ` Gavin Shan
2023-01-18  9:21 ` [PATCH 2/2] KVM: selftests: Assign guest page size in sync area early " Gavin Shan
2023-01-23 23:57   ` Maciej S. Szmigiero
2023-02-08  2:07 ` [PATCH 0/2] KVM: selftests: Remove duplicate VM " Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.