Skip to content

Commit

Permalink
KVM: selftests: Convert ARM's vGIC IRQ test to printf style GUEST_ASSERT
Browse files Browse the repository at this point in the history
Use printf-based guest assert reporting in ARM's vGIC IRQ test.  Note,
this is not as innocuous as it looks!  The printf-based version of
GUEST_ASSERT_EQ() ensures the expressions are evaluated only once, whereas
the old version did not!

Link: https://lore.kernel.org/r/20230729003643.1053367-15-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
sean-jc committed Aug 2, 2023
1 parent df27f6b commit d0ad3ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/testing/selftests/kvm/aarch64/vgic_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* host to inject a specific intid via a GUEST_SYNC call, and then checks that
* it received it.
*/
#define USE_GUEST_ASSERT_PRINTF 1

#include <asm/kvm.h>
#include <asm/kvm_para.h>
Expand Down Expand Up @@ -781,7 +782,7 @@ static void test_vgic(uint32_t nr_irqs, bool level_sensitive, bool eoi_split)
run_guest_cmd(vcpu, gic_fd, &inject_args, &args);
break;
case UCALL_ABORT:
REPORT_GUEST_ASSERT_2(uc, "values: %#lx, %#lx");
REPORT_GUEST_ASSERT(uc);
break;
case UCALL_DONE:
goto done;
Expand Down

0 comments on commit d0ad3ba

Please sign in to comment.