From: Sean Christopherson Date: Sat, 29 Jul 2023 00:36:24 +0000 (-0700) Subject: KVM: selftests: Convert the memslot performance test to printf guest asserts X-Git-Tag: v6.6.7~1953^2~7^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c55a475d5fc42931992b667aa16bed2db6058d06;p=platform%2Fkernel%2Flinux-starfive.git KVM: selftests: Convert the memslot performance test to printf guest asserts Use the printf-based GUEST_ASSERT_EQ() in the memslot perf test instead of an half-baked open code version. Link: https://lore.kernel.org/r/20230729003643.1053367-16-seanjc@google.com Signed-off-by: Sean Christopherson --- diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c index 4210cd2..55f1bc7 100644 --- a/tools/testing/selftests/kvm/memslot_perf_test.c +++ b/tools/testing/selftests/kvm/memslot_perf_test.c @@ -6,6 +6,8 @@ * * Basic guest setup / host vCPU thread code lifted from set_memory_region_test. */ +#define USE_GUEST_ASSERT_PRINTF 1 + #include #include #include @@ -157,7 +159,7 @@ static void *vcpu_worker(void *__data) goto done; break; case UCALL_ABORT: - REPORT_GUEST_ASSERT_1(uc, "val = %lu"); + REPORT_GUEST_ASSERT(uc); break; case UCALL_DONE: goto done; @@ -560,7 +562,7 @@ static void guest_code_test_memslot_rw(void) ptr < MEM_TEST_GPA + MEM_TEST_SIZE; ptr += page_size) { uint64_t val = *(uint64_t *)ptr; - GUEST_ASSERT_1(val == MEM_TEST_VAL_2, val); + GUEST_ASSERT_EQ(val, MEM_TEST_VAL_2); *(uint64_t *)ptr = 0; }