Skip to content

Commit df27f6b

Browse files
committed
KVM: selftests: Convert ARM's page fault test to printf style GUEST_ASSERT
Use GUEST_FAIL() in ARM's page fault test to report unexpected faults. Link: https://lore.kernel.org/r/20230729003643.1053367-14-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent af5b41b commit df27f6b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/testing/selftests/kvm/aarch64/page_fault_test.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* hugetlbfs with a hole). It checks that the expected handling method is
88
* called (e.g., uffd faults with the right address and write/read flag).
99
*/
10+
#define USE_GUEST_ASSERT_PRINTF 1
1011

1112
#define _GNU_SOURCE
1213
#include <linux/bitmap.h>
@@ -293,12 +294,12 @@ static void guest_code(struct test_desc *test)
293294

294295
static void no_dabt_handler(struct ex_regs *regs)
295296
{
296-
GUEST_ASSERT_1(false, read_sysreg(far_el1));
297+
GUEST_FAIL("Unexpected dabt, far_el1 = 0x%llx", read_sysreg(far_el1));
297298
}
298299

299300
static void no_iabt_handler(struct ex_regs *regs)
300301
{
301-
GUEST_ASSERT_1(false, regs->pc);
302+
GUEST_FAIL("Unexpected iabt, pc = 0x%lx", regs->pc);
302303
}
303304

304305
static struct uffd_args {
@@ -679,7 +680,7 @@ static void vcpu_run_loop(struct kvm_vm *vm, struct kvm_vcpu *vcpu,
679680
}
680681
break;
681682
case UCALL_ABORT:
682-
REPORT_GUEST_ASSERT_2(uc, "values: %#lx, %#lx");
683+
REPORT_GUEST_ASSERT(uc);
683684
break;
684685
case UCALL_DONE:
685686
goto done;

0 commit comments

Comments
 (0)