Commit bf6c760b authored by Sean Christopherson's avatar Sean Christopherson

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/20230729003643.1053367-24-seanjc@google.comSigned-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 8d1d3ce6
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* *
* Tests for KVM paravirtual feature disablement * Tests for KVM paravirtual feature disablement
*/ */
#define USE_GUEST_ASSERT_PRINTF 1
#include <asm/kvm_para.h> #include <asm/kvm_para.h>
#include <linux/kvm_para.h> #include <linux/kvm_para.h>
#include <stdint.h> #include <stdint.h>
...@@ -46,10 +48,10 @@ static void test_msr(struct msr_data *msr) ...@@ -46,10 +48,10 @@ static void test_msr(struct msr_data *msr)
PR_MSR(msr); PR_MSR(msr);
vector = rdmsr_safe(msr->idx, &ignored); 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); vector = wrmsr_safe(msr->idx, 0);
GUEST_ASSERT_1(vector == GP_VECTOR, vector); GUEST_ASSERT_EQ(vector, GP_VECTOR);
} }
struct hcall_data { struct hcall_data {
...@@ -77,7 +79,7 @@ static void test_hcall(struct hcall_data *hc) ...@@ -77,7 +79,7 @@ static void test_hcall(struct hcall_data *hc)
PR_HCALL(hc); PR_HCALL(hc);
r = kvm_hypercall(hc->nr, 0, 0, 0, 0); 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) static void guest_main(void)
...@@ -125,7 +127,7 @@ static void enter_guest(struct kvm_vcpu *vcpu) ...@@ -125,7 +127,7 @@ static void enter_guest(struct kvm_vcpu *vcpu)
pr_hcall(&uc); pr_hcall(&uc);
break; break;
case UCALL_ABORT: case UCALL_ABORT:
REPORT_GUEST_ASSERT_1(uc, "vector = %lu"); REPORT_GUEST_ASSERT(uc);
return; return;
case UCALL_DONE: case UCALL_DONE:
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment