Skip to content

Commit

Permalink
KVM: selftests: Convert x86's nested exceptions test to printf guest …
Browse files Browse the repository at this point in the history
…asserts

Convert x86's nested exceptions test to printf-based guest asserts, and
use REPORT_GUEST_ASSERT() instead of TEST_FAIL() so that output is
formatted correctly.

Link: https://lore.kernel.org/r/20230729003643.1053367-26-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
sean-jc committed Aug 2, 2023
1 parent 0f52e4a commit b13a307
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#define USE_GUEST_ASSERT_PRINTF 1

#define _GNU_SOURCE /* for program_invocation_short_name */

#include "test_util.h"
Expand Down Expand Up @@ -180,9 +182,7 @@ static void assert_ucall_vector(struct kvm_vcpu *vcpu, int vector)
"Expected L2 to ask for %d, L2 says it's done", vector);
break;
case UCALL_ABORT:
TEST_FAIL("%s at %s:%ld (0x%lx != 0x%lx)",
(const char *)uc.args[0], __FILE__, uc.args[1],
uc.args[2], uc.args[3]);
REPORT_GUEST_ASSERT(uc);
break;
default:
TEST_FAIL("Expected L2 to ask for %d, got unexpected ucall %lu", vector, uc.cmd);
Expand Down

0 comments on commit b13a307

Please sign in to comment.