* [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 @ 2021-09-07 18:09 Ricardo Koller 2021-09-07 18:09 ` [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent Ricardo Koller ` (3 more replies) 0 siblings, 4 replies; 11+ messages in thread From: Ricardo Koller @ 2021-09-07 18:09 UTC (permalink / raw) To: kvm, kvmarm; +Cc: maz, pshier, Paolo Bonzini, maciej.szmigiero Enable memslot_modification_stress_test and memslot_perf_test in ARM64 (second patch). memslot_modification_stress_test builds and runs in aarch64 without any modification. memslot_perf_test needs some nits regarding ucalls (first patch). Can anybody try these two tests in s390, please? Changes: v2: Makefile tests in the right order (from Andrew). Ricardo Koller (2): KVM: selftests: make memslot_perf_test arch independent KVM: selftests: build the memslot tests for arm64 tools/testing/selftests/kvm/Makefile | 2 + .../testing/selftests/kvm/memslot_perf_test.c | 56 +++++++++++-------- 2 files changed, 36 insertions(+), 22 deletions(-) -- 2.33.0.153.gba50c8fa24-goog _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent 2021-09-07 18:09 [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Ricardo Koller @ 2021-09-07 18:09 ` Ricardo Koller 2021-09-07 18:18 ` Andrew Jones 2021-09-07 19:06 ` Oliver Upton 2021-09-07 18:09 ` [PATCH v2 2/2] KVM: selftests: build the memslot tests for arm64 Ricardo Koller ` (2 subsequent siblings) 3 siblings, 2 replies; 11+ messages in thread From: Ricardo Koller @ 2021-09-07 18:09 UTC (permalink / raw) To: kvm, kvmarm; +Cc: maz, pshier, Paolo Bonzini, maciej.szmigiero memslot_perf_test uses ucalls for synchronization between guest and host. Ucalls API is architecture independent: tests do not need to know details like what kind of exit they generate on a specific arch. More specifically, there is no need to check whether an exit is KVM_EXIT_IO in x86 for the host to know that the exit is ucall related, as get_ucall() already makes that check. Change memslot_perf_test to not require specifying what exit does a ucall generate. Also add a missing ucall_init. Signed-off-by: Ricardo Koller <ricarkol@google.com> --- .../testing/selftests/kvm/memslot_perf_test.c | 56 +++++++++++-------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c index d6e381e01db7..1727f75e0c2c 100644 --- a/tools/testing/selftests/kvm/memslot_perf_test.c +++ b/tools/testing/selftests/kvm/memslot_perf_test.c @@ -127,43 +127,54 @@ static bool verbose; pr_info(__VA_ARGS__); \ } while (0) +static void check_mmio_access(struct vm_data *vm, struct kvm_run *run) +{ + TEST_ASSERT(vm->mmio_ok, "Unexpected mmio exit"); + TEST_ASSERT(run->mmio.is_write, "Unexpected mmio read"); + TEST_ASSERT(run->mmio.len == 8, + "Unexpected exit mmio size = %u", run->mmio.len); + TEST_ASSERT(run->mmio.phys_addr >= vm->mmio_gpa_min && + run->mmio.phys_addr <= vm->mmio_gpa_max, + "Unexpected exit mmio address = 0x%llx", + run->mmio.phys_addr); +} + static void *vcpu_worker(void *data) { struct vm_data *vm = data; struct kvm_run *run; struct ucall uc; - uint64_t cmd; run = vcpu_state(vm->vm, VCPU_ID); while (1) { vcpu_run(vm->vm, VCPU_ID); - if (run->exit_reason == KVM_EXIT_IO) { - cmd = get_ucall(vm->vm, VCPU_ID, &uc); - if (cmd != UCALL_SYNC) - break; - + switch (get_ucall(vm->vm, VCPU_ID, &uc)) { + case UCALL_SYNC: + TEST_ASSERT(uc.args[1] == 0, + "Unexpected sync ucall, got %lx", + (ulong)uc.args[1]); sem_post(&vcpu_ready); continue; - } - - if (run->exit_reason != KVM_EXIT_MMIO) + case UCALL_NONE: + if (run->exit_reason == KVM_EXIT_MMIO) + check_mmio_access(vm, run); + else + goto done; break; - - TEST_ASSERT(vm->mmio_ok, "Unexpected mmio exit"); - TEST_ASSERT(run->mmio.is_write, "Unexpected mmio read"); - TEST_ASSERT(run->mmio.len == 8, - "Unexpected exit mmio size = %u", run->mmio.len); - TEST_ASSERT(run->mmio.phys_addr >= vm->mmio_gpa_min && - run->mmio.phys_addr <= vm->mmio_gpa_max, - "Unexpected exit mmio address = 0x%llx", - run->mmio.phys_addr); + case UCALL_ABORT: + TEST_FAIL("%s at %s:%ld, val = %lu", + (const char *)uc.args[0], + __FILE__, uc.args[1], uc.args[2]); + break; + case UCALL_DONE: + goto done; + default: + TEST_FAIL("Unknown ucall %lu", uc.cmd); + } } - if (run->exit_reason == KVM_EXIT_IO && cmd == UCALL_ABORT) - TEST_FAIL("%s at %s:%ld, val = %lu", (const char *)uc.args[0], - __FILE__, uc.args[1], uc.args[2]); - +done: return NULL; } @@ -268,6 +279,7 @@ static bool prepare_vm(struct vm_data *data, int nslots, uint64_t *maxslots, TEST_ASSERT(data->hva_slots, "malloc() fail"); data->vm = vm_create_default(VCPU_ID, mempages, guest_code); + ucall_init(data->vm, NULL); pr_info_v("Adding slots 1..%i, each slot with %"PRIu64" pages + %"PRIu64" extra pages last\n", max_mem_slots - 1, data->pages_per_slot, rempages); -- 2.33.0.153.gba50c8fa24-goog _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent 2021-09-07 18:09 ` [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent Ricardo Koller @ 2021-09-07 18:18 ` Andrew Jones 2021-09-07 19:06 ` Oliver Upton 1 sibling, 0 replies; 11+ messages in thread From: Andrew Jones @ 2021-09-07 18:18 UTC (permalink / raw) To: Ricardo Koller; +Cc: kvm, maz, pshier, Paolo Bonzini, maciej.szmigiero, kvmarm On Tue, Sep 07, 2021 at 11:09:56AM -0700, Ricardo Koller wrote: > memslot_perf_test uses ucalls for synchronization between guest and > host. Ucalls API is architecture independent: tests do not need to know > details like what kind of exit they generate on a specific arch. More > specifically, there is no need to check whether an exit is KVM_EXIT_IO > in x86 for the host to know that the exit is ucall related, as > get_ucall() already makes that check. > > Change memslot_perf_test to not require specifying what exit does a > ucall generate. Also add a missing ucall_init. > > Signed-off-by: Ricardo Koller <ricarkol@google.com> > --- > .../testing/selftests/kvm/memslot_perf_test.c | 56 +++++++++++-------- > 1 file changed, 34 insertions(+), 22 deletions(-) > Reviewed-by: Andrew Jones <drjones@redhat.com> _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent 2021-09-07 18:09 ` [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent Ricardo Koller 2021-09-07 18:18 ` Andrew Jones @ 2021-09-07 19:06 ` Oliver Upton 1 sibling, 0 replies; 11+ messages in thread From: Oliver Upton @ 2021-09-07 19:06 UTC (permalink / raw) To: Ricardo Koller; +Cc: kvm, maz, pshier, Paolo Bonzini, maciej.szmigiero, kvmarm On Tue, Sep 7, 2021 at 1:10 PM Ricardo Koller <ricarkol@google.com> wrote: > > memslot_perf_test uses ucalls for synchronization between guest and > host. Ucalls API is architecture independent: tests do not need to know > details like what kind of exit they generate on a specific arch. More > specifically, there is no need to check whether an exit is KVM_EXIT_IO > in x86 for the host to know that the exit is ucall related, as > get_ucall() already makes that check. > > Change memslot_perf_test to not require specifying what exit does a > ucall generate. Also add a missing ucall_init. > > Signed-off-by: Ricardo Koller <ricarkol@google.com> > --- > .../testing/selftests/kvm/memslot_perf_test.c | 56 +++++++++++-------- > 1 file changed, 34 insertions(+), 22 deletions(-) > Reviewed-by: Oliver Upton <oupton@google.com> _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/2] KVM: selftests: build the memslot tests for arm64 2021-09-07 18:09 [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Ricardo Koller 2021-09-07 18:09 ` [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent Ricardo Koller @ 2021-09-07 18:09 ` Ricardo Koller 2021-09-07 18:18 ` Andrew Jones 2021-09-07 19:05 ` Oliver Upton 2021-09-07 18:17 ` [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Andrew Jones 2021-10-21 12:47 ` Marc Zyngier 3 siblings, 2 replies; 11+ messages in thread From: Ricardo Koller @ 2021-09-07 18:09 UTC (permalink / raw) To: kvm, kvmarm; +Cc: maz, pshier, Paolo Bonzini, maciej.szmigiero Add memslot_perf_test and memslot_modification_stress_test to the list of aarch64 selftests. Signed-off-by: Ricardo Koller <ricarkol@google.com> --- tools/testing/selftests/kvm/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 5832f510a16c..5ed203b9314c 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -92,6 +92,8 @@ TEST_GEN_PROGS_aarch64 += dirty_log_test TEST_GEN_PROGS_aarch64 += dirty_log_perf_test TEST_GEN_PROGS_aarch64 += kvm_create_max_vcpus TEST_GEN_PROGS_aarch64 += kvm_page_table_test +TEST_GEN_PROGS_aarch64 += memslot_modification_stress_test +TEST_GEN_PROGS_aarch64 += memslot_perf_test TEST_GEN_PROGS_aarch64 += set_memory_region_test TEST_GEN_PROGS_aarch64 += steal_time TEST_GEN_PROGS_aarch64 += kvm_binary_stats_test -- 2.33.0.153.gba50c8fa24-goog _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] KVM: selftests: build the memslot tests for arm64 2021-09-07 18:09 ` [PATCH v2 2/2] KVM: selftests: build the memslot tests for arm64 Ricardo Koller @ 2021-09-07 18:18 ` Andrew Jones 2021-09-07 19:05 ` Oliver Upton 1 sibling, 0 replies; 11+ messages in thread From: Andrew Jones @ 2021-09-07 18:18 UTC (permalink / raw) To: Ricardo Koller; +Cc: kvm, maz, pshier, Paolo Bonzini, maciej.szmigiero, kvmarm On Tue, Sep 07, 2021 at 11:09:57AM -0700, Ricardo Koller wrote: > Add memslot_perf_test and memslot_modification_stress_test to the list > of aarch64 selftests. > > Signed-off-by: Ricardo Koller <ricarkol@google.com> > --- > tools/testing/selftests/kvm/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile > index 5832f510a16c..5ed203b9314c 100644 > --- a/tools/testing/selftests/kvm/Makefile > +++ b/tools/testing/selftests/kvm/Makefile > @@ -92,6 +92,8 @@ TEST_GEN_PROGS_aarch64 += dirty_log_test > TEST_GEN_PROGS_aarch64 += dirty_log_perf_test > TEST_GEN_PROGS_aarch64 += kvm_create_max_vcpus > TEST_GEN_PROGS_aarch64 += kvm_page_table_test > +TEST_GEN_PROGS_aarch64 += memslot_modification_stress_test > +TEST_GEN_PROGS_aarch64 += memslot_perf_test > TEST_GEN_PROGS_aarch64 += set_memory_region_test > TEST_GEN_PROGS_aarch64 += steal_time > TEST_GEN_PROGS_aarch64 += kvm_binary_stats_test > -- > 2.33.0.153.gba50c8fa24-goog > Reviewed-by: Andrew Jones <drjones@redhat.com> _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] KVM: selftests: build the memslot tests for arm64 2021-09-07 18:09 ` [PATCH v2 2/2] KVM: selftests: build the memslot tests for arm64 Ricardo Koller 2021-09-07 18:18 ` Andrew Jones @ 2021-09-07 19:05 ` Oliver Upton 1 sibling, 0 replies; 11+ messages in thread From: Oliver Upton @ 2021-09-07 19:05 UTC (permalink / raw) To: Ricardo Koller; +Cc: kvm, maz, pshier, Paolo Bonzini, maciej.szmigiero, kvmarm On Tue, Sep 7, 2021 at 1:10 PM Ricardo Koller <ricarkol@google.com> wrote: > > Add memslot_perf_test and memslot_modification_stress_test to the list > of aarch64 selftests. > > Signed-off-by: Ricardo Koller <ricarkol@google.com> > --- > tools/testing/selftests/kvm/Makefile | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Oliver Upton <oupton@google.com> _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 2021-09-07 18:09 [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Ricardo Koller 2021-09-07 18:09 ` [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent Ricardo Koller 2021-09-07 18:09 ` [PATCH v2 2/2] KVM: selftests: build the memslot tests for arm64 Ricardo Koller @ 2021-09-07 18:17 ` Andrew Jones 2021-09-07 20:52 ` Ricardo Koller 2021-10-19 21:17 ` Ricardo Koller 2021-10-21 12:47 ` Marc Zyngier 3 siblings, 2 replies; 11+ messages in thread From: Andrew Jones @ 2021-09-07 18:17 UTC (permalink / raw) To: Ricardo Koller; +Cc: kvm, maz, pshier, Paolo Bonzini, maciej.szmigiero, kvmarm On Tue, Sep 07, 2021 at 11:09:55AM -0700, Ricardo Koller wrote: > Enable memslot_modification_stress_test and memslot_perf_test in ARM64 > (second patch). memslot_modification_stress_test builds and runs in > aarch64 without any modification. memslot_perf_test needs some nits > regarding ucalls (first patch). > > Can anybody try these two tests in s390, please? > > Changes: > v2: Makefile tests in the right order (from Andrew). Hi Ricardo, You could have collected all the r-b's too. Thanks, drew > > Ricardo Koller (2): > KVM: selftests: make memslot_perf_test arch independent > KVM: selftests: build the memslot tests for arm64 > > tools/testing/selftests/kvm/Makefile | 2 + > .../testing/selftests/kvm/memslot_perf_test.c | 56 +++++++++++-------- > 2 files changed, 36 insertions(+), 22 deletions(-) > > -- > 2.33.0.153.gba50c8fa24-goog > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 2021-09-07 18:17 ` [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Andrew Jones @ 2021-09-07 20:52 ` Ricardo Koller 2021-10-19 21:17 ` Ricardo Koller 1 sibling, 0 replies; 11+ messages in thread From: Ricardo Koller @ 2021-09-07 20:52 UTC (permalink / raw) To: Andrew Jones; +Cc: kvm, maz, pshier, Paolo Bonzini, maciej.szmigiero, kvmarm On Tue, Sep 07, 2021 at 08:17:37PM +0200, Andrew Jones wrote: > On Tue, Sep 07, 2021 at 11:09:55AM -0700, Ricardo Koller wrote: > > Enable memslot_modification_stress_test and memslot_perf_test in ARM64 > > (second patch). memslot_modification_stress_test builds and runs in > > aarch64 without any modification. memslot_perf_test needs some nits > > regarding ucalls (first patch). > > > > Can anybody try these two tests in s390, please? > > > > Changes: > > v2: Makefile tests in the right order (from Andrew). > > Hi Ricardo, > > You could have collected all the r-b's too. Thanks Andrew. Will try to do it next time (if changes are small like in this patch set. Thanks, Ricardo > > Thanks, > drew > > > > > Ricardo Koller (2): > > KVM: selftests: make memslot_perf_test arch independent > > KVM: selftests: build the memslot tests for arm64 > > > > tools/testing/selftests/kvm/Makefile | 2 + > > .../testing/selftests/kvm/memslot_perf_test.c | 56 +++++++++++-------- > > 2 files changed, 36 insertions(+), 22 deletions(-) > > > > -- > > 2.33.0.153.gba50c8fa24-goog > > > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 2021-09-07 18:17 ` [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Andrew Jones 2021-09-07 20:52 ` Ricardo Koller @ 2021-10-19 21:17 ` Ricardo Koller 1 sibling, 0 replies; 11+ messages in thread From: Ricardo Koller @ 2021-10-19 21:17 UTC (permalink / raw) To: Andrew Jones; +Cc: kvm, maz, pshier, Paolo Bonzini, maciej.szmigiero, kvmarm On Tue, Sep 07, 2021 at 08:17:37PM +0200, Andrew Jones wrote: > On Tue, Sep 07, 2021 at 11:09:55AM -0700, Ricardo Koller wrote: > > Enable memslot_modification_stress_test and memslot_perf_test in ARM64 > > (second patch). memslot_modification_stress_test builds and runs in > > aarch64 without any modification. memslot_perf_test needs some nits > > regarding ucalls (first patch). > > > > Can anybody try these two tests in s390, please? > > > > Changes: > > v2: Makefile tests in the right order (from Andrew). > > Hi Ricardo, > > You could have collected all the r-b's too. > > Thanks, > drew > Friendly ping on this one, please. > > > > Ricardo Koller (2): > > KVM: selftests: make memslot_perf_test arch independent > > KVM: selftests: build the memslot tests for arm64 > > > > tools/testing/selftests/kvm/Makefile | 2 + > > .../testing/selftests/kvm/memslot_perf_test.c | 56 +++++++++++-------- > > 2 files changed, 36 insertions(+), 22 deletions(-) > > > > -- > > 2.33.0.153.gba50c8fa24-goog > > > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 2021-09-07 18:09 [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Ricardo Koller ` (2 preceding siblings ...) 2021-09-07 18:17 ` [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Andrew Jones @ 2021-10-21 12:47 ` Marc Zyngier 3 siblings, 0 replies; 11+ messages in thread From: Marc Zyngier @ 2021-10-21 12:47 UTC (permalink / raw) To: kvmarm, kvm, Ricardo Koller; +Cc: pshier, Paolo Bonzini, maciej.szmigiero On Tue, 7 Sep 2021 11:09:55 -0700, Ricardo Koller wrote: > Enable memslot_modification_stress_test and memslot_perf_test in ARM64 > (second patch). memslot_modification_stress_test builds and runs in > aarch64 without any modification. memslot_perf_test needs some nits > regarding ucalls (first patch). > > Can anybody try these two tests in s390, please? > > [...] Applied to next, thanks! [1/2] KVM: selftests: make memslot_perf_test arch independent commit: ffb4ce3c49366f02f1c064fbe2e66a96ab5f98b8 [2/2] KVM: selftests: build the memslot tests for arm64 commit: 358928fd5264f069b9758f8b29297c7bff2a06de Cheers, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-10-21 12:47 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-09-07 18:09 [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Ricardo Koller 2021-09-07 18:09 ` [PATCH v2 1/2] KVM: selftests: make memslot_perf_test arch independent Ricardo Koller 2021-09-07 18:18 ` Andrew Jones 2021-09-07 19:06 ` Oliver Upton 2021-09-07 18:09 ` [PATCH v2 2/2] KVM: selftests: build the memslot tests for arm64 Ricardo Koller 2021-09-07 18:18 ` Andrew Jones 2021-09-07 19:05 ` Oliver Upton 2021-09-07 18:17 ` [PATCH v2 0/2] KVM: selftests: enable the memslot tests in ARM64 Andrew Jones 2021-09-07 20:52 ` Ricardo Koller 2021-10-19 21:17 ` Ricardo Koller 2021-10-21 12:47 ` Marc Zyngier
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).