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-
1110#define _GNU_SOURCE
1211#include <linux/bitmap.h>
1312#include <fcntl.h>
@@ -293,12 +292,12 @@ static void guest_code(struct test_desc *test)
293292
294293static void no_dabt_handler (struct ex_regs * regs )
295294{
296- GUEST_ASSERT_1 (false , read_sysreg (far_el1 ));
295+ GUEST_FAIL ( "Unexpected dabt, far_el1 = 0x%llx" , read_sysreg (far_el1 ));
297296}
298297
299298static void no_iabt_handler (struct ex_regs * regs )
300299{
301- GUEST_ASSERT_1 (false , regs -> pc );
300+ GUEST_FAIL ( "Unexpected iabt, pc = 0x%lx" , regs -> pc );
302301}
303302
304303static struct uffd_args {
@@ -318,7 +317,7 @@ static int uffd_generic_handler(int uffd_mode, int uffd, struct uffd_msg *msg,
318317
319318 TEST_ASSERT (uffd_mode == UFFDIO_REGISTER_MODE_MISSING ,
320319 "The only expected UFFD mode is MISSING" );
321- ASSERT_EQ (addr , (uint64_t )args -> hva );
320+ TEST_ASSERT_EQ (addr , (uint64_t )args -> hva );
322321
323322 pr_debug ("uffd fault: addr=%p write=%d\n" ,
324323 (void * )addr , !!(flags & UFFD_PAGEFAULT_FLAG_WRITE ));
@@ -432,7 +431,7 @@ static void mmio_on_test_gpa_handler(struct kvm_vm *vm, struct kvm_run *run)
432431 region = vm_get_mem_region (vm , MEM_REGION_TEST_DATA );
433432 hva = (void * )region -> region .userspace_addr ;
434433
435- ASSERT_EQ (run -> mmio .phys_addr , region -> region .guest_phys_addr );
434+ TEST_ASSERT_EQ (run -> mmio .phys_addr , region -> region .guest_phys_addr );
436435
437436 memcpy (hva , run -> mmio .data , run -> mmio .len );
438437 events .mmio_exits += 1 ;
@@ -631,9 +630,9 @@ static void setup_default_handlers(struct test_desc *test)
631630
632631static void check_event_counts (struct test_desc * test )
633632{
634- ASSERT_EQ (test -> expected_events .uffd_faults , events .uffd_faults );
635- ASSERT_EQ (test -> expected_events .mmio_exits , events .mmio_exits );
636- ASSERT_EQ (test -> expected_events .fail_vcpu_runs , events .fail_vcpu_runs );
633+ TEST_ASSERT_EQ (test -> expected_events .uffd_faults , events .uffd_faults );
634+ TEST_ASSERT_EQ (test -> expected_events .mmio_exits , events .mmio_exits );
635+ TEST_ASSERT_EQ (test -> expected_events .fail_vcpu_runs , events .fail_vcpu_runs );
637636}
638637
639638static void print_test_banner (enum vm_guest_mode mode , struct test_params * p )
@@ -679,7 +678,7 @@ static void vcpu_run_loop(struct kvm_vm *vm, struct kvm_vcpu *vcpu,
679678 }
680679 break ;
681680 case UCALL_ABORT :
682- REPORT_GUEST_ASSERT_2 (uc , "values: %#lx, %#lx" );
681+ REPORT_GUEST_ASSERT (uc );
683682 break ;
684683 case UCALL_DONE :
685684 goto done ;
0 commit comments