Skip to content

Commit b13a307

Browse files
committed
KVM: selftests: Convert x86's nested exceptions test to printf guest 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/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 0f52e4a commit b13a307

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2+
#define USE_GUEST_ASSERT_PRINTF 1
3+
24
#define _GNU_SOURCE /* for program_invocation_short_name */
35

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

0 commit comments

Comments
 (0)