Skip to content

Commit bf6c760

Browse files
committed
KVM: selftests: Convert x86's KVM paravirt test to printf style GUEST_ASSERT
Convert x86's KVM paravirtualization test to use the printf-based GUEST_ASSERT_EQ(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 8d1d3ce commit bf6c760

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tools/testing/selftests/kvm/x86_64/kvm_pv_test.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*
55
* Tests for KVM paravirtual feature disablement
66
*/
7+
#define USE_GUEST_ASSERT_PRINTF 1
8+
79
#include <asm/kvm_para.h>
810
#include <linux/kvm_para.h>
911
#include <stdint.h>
@@ -46,10 +48,10 @@ static void test_msr(struct msr_data *msr)
4648
PR_MSR(msr);
4749

4850
vector = rdmsr_safe(msr->idx, &ignored);
49-
GUEST_ASSERT_1(vector == GP_VECTOR, vector);
51+
GUEST_ASSERT_EQ(vector, GP_VECTOR);
5052

5153
vector = wrmsr_safe(msr->idx, 0);
52-
GUEST_ASSERT_1(vector == GP_VECTOR, vector);
54+
GUEST_ASSERT_EQ(vector, GP_VECTOR);
5355
}
5456

5557
struct hcall_data {
@@ -77,7 +79,7 @@ static void test_hcall(struct hcall_data *hc)
7779

7880
PR_HCALL(hc);
7981
r = kvm_hypercall(hc->nr, 0, 0, 0, 0);
80-
GUEST_ASSERT(r == -KVM_ENOSYS);
82+
GUEST_ASSERT_EQ(r, -KVM_ENOSYS);
8183
}
8284

8385
static void guest_main(void)
@@ -125,7 +127,7 @@ static void enter_guest(struct kvm_vcpu *vcpu)
125127
pr_hcall(&uc);
126128
break;
127129
case UCALL_ABORT:
128-
REPORT_GUEST_ASSERT_1(uc, "vector = %lu");
130+
REPORT_GUEST_ASSERT(uc);
129131
return;
130132
case UCALL_DONE:
131133
return;

0 commit comments

Comments
 (0)