[PATCH v4 23/34] KVM: selftests: Convert x86's KVM paravirt test to printf style GUEST_ASSERT
Sean Christopherson
seanjc at google.com
Fri Jul 28 17:36:32 PDT 2023
Convert x86's KVM paravirtualization test to use the printf-based
GUEST_ASSERT_EQ().
Signed-off-by: Sean Christopherson <seanjc at google.com>
---
tools/testing/selftests/kvm/x86_64/kvm_pv_test.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c b/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
index f774a9e62858..1c28b77ff3cd 100644
--- a/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
+++ b/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
@@ -4,6 +4,8 @@
*
* Tests for KVM paravirtual feature disablement
*/
+#define USE_GUEST_ASSERT_PRINTF 1
+
#include <asm/kvm_para.h>
#include <linux/kvm_para.h>
#include <stdint.h>
@@ -46,10 +48,10 @@ static void test_msr(struct msr_data *msr)
PR_MSR(msr);
vector = rdmsr_safe(msr->idx, &ignored);
- GUEST_ASSERT_1(vector == GP_VECTOR, vector);
+ GUEST_ASSERT_EQ(vector, GP_VECTOR);
vector = wrmsr_safe(msr->idx, 0);
- GUEST_ASSERT_1(vector == GP_VECTOR, vector);
+ GUEST_ASSERT_EQ(vector, GP_VECTOR);
}
struct hcall_data {
@@ -77,7 +79,7 @@ static void test_hcall(struct hcall_data *hc)
PR_HCALL(hc);
r = kvm_hypercall(hc->nr, 0, 0, 0, 0);
- GUEST_ASSERT(r == -KVM_ENOSYS);
+ GUEST_ASSERT_EQ(r, -KVM_ENOSYS);
}
static void guest_main(void)
@@ -125,7 +127,7 @@ static void enter_guest(struct kvm_vcpu *vcpu)
pr_hcall(&uc);
break;
case UCALL_ABORT:
- REPORT_GUEST_ASSERT_1(uc, "vector = %lu");
+ REPORT_GUEST_ASSERT(uc);
return;
case UCALL_DONE:
return;
--
2.41.0.487.g6d72f3e995-goog
More information about the linux-arm-kernel
mailing list