mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-28 21:46:02 -04:00
KVM: selftests: Fix filename reporting in guest asserts
Fix filename reporting in guest asserts by ensuring the GUEST_ASSERT
macro records __FILE__ and substituting REPORT_GUEST_ASSERT for many
repetitive calls to TEST_FAIL.
Previously filename was reported by using __FILE__ directly in the
selftest, wrongly assuming it would always be the same as where the
assertion failed.
Signed-off-by: Colton Lewis <coltonlewis@google.com>
Reported-by: Ricardo Koller <ricarkol@google.com>
Fixes: 4e18bccc2e
Link: https://lore.kernel.org/r/20220615193116.806312-5-coltonlewis@google.com
[sean: convert more TEST_FAIL => REPORT_GUEST_ASSERT instances]
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
committed by
Sean Christopherson
parent
ddcb57afd5
commit
594a1c271c
@@ -231,10 +231,13 @@ static void *test_vcpu_run(void *arg)
|
||||
break;
|
||||
case UCALL_ABORT:
|
||||
sync_global_from_guest(vm, *shared_data);
|
||||
TEST_FAIL("%s at %s:%ld\n\tvalues: %lu, %lu; %lu, vcpu: %u; stage: %u; iter: %u",
|
||||
(const char *)uc.args[0], __FILE__, uc.args[1],
|
||||
uc.args[2], uc.args[3], uc.args[4], vcpu_idx,
|
||||
shared_data->guest_stage, shared_data->nr_iter);
|
||||
REPORT_GUEST_ASSERT_N(uc, "values: %lu, %lu; %lu, vcpu %u; stage; %u; iter: %u",
|
||||
GUEST_ASSERT_ARG(uc, 0),
|
||||
GUEST_ASSERT_ARG(uc, 1),
|
||||
GUEST_ASSERT_ARG(uc, 2),
|
||||
vcpu_idx,
|
||||
shared_data->guest_stage,
|
||||
shared_data->nr_iter);
|
||||
break;
|
||||
default:
|
||||
TEST_FAIL("Unexpected guest exit\n");
|
||||
|
||||
Reference in New Issue
Block a user