Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: selftests: enumerate GUEST_ASSERT arguments

Enumerate GUEST_ASSERT arguments to avoid magic indices to ucall.args.

Signed-off-by: Colton Lewis <coltonlewis@google.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Link: https://lore.kernel.org/r/20220615193116.806312-2-coltonlewis@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

authored by

Colton Lewis and committed by
Sean Christopherson
8fb2638a 0bc27326

+8
+8
tools/testing/selftests/kvm/include/ucall_common.h
··· 32 32 ucall(UCALL_SYNC, 6, "hello", stage, arg1, arg2, arg3, arg4) 33 33 #define GUEST_SYNC(stage) ucall(UCALL_SYNC, 2, "hello", stage) 34 34 #define GUEST_DONE() ucall(UCALL_DONE, 0) 35 + 36 + enum guest_assert_builtin_args { 37 + GUEST_ERROR_STRING, 38 + GUEST_FILE, 39 + GUEST_LINE, 40 + GUEST_ASSERT_BUILTIN_NARGS 41 + }; 42 + 35 43 #define __GUEST_ASSERT(_condition, _condstr, _nargs, _args...) do { \ 36 44 if (!(_condition)) \ 37 45 ucall(UCALL_ABORT, 2 + _nargs, \