[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230729003643.1053367-16-seanjc@google.com>
Date: Fri, 28 Jul 2023 17:36:24 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Paolo Bonzini <pbonzini@...hat.com>, Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>
Cc: kvm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.linux.dev, linux-kernel@...r.kernel.org,
Sean Christopherson <seanjc@...gle.com>,
Thomas Huth <thuth@...hat.com>,
"Philippe Mathieu-Daudé" <philmd@...aro.org>,
Aaron Lewis <aaronlewis@...gle.com>
Subject: [PATCH v4 15/34] 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.
Signed-off-by: Sean Christopherson <seanjc@...gle.com>
---
tools/testing/selftests/kvm/memslot_perf_test.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index 4210cd21d159..55f1bc70e571 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 <pthread.h>
#include <sched.h>
#include <semaphore.h>
@@ -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;
}
--
2.41.0.487.g6d72f3e995-goog
Powered by blists - more mailing lists