Commit 8fb2638a authored by Colton Lewis's avatar Colton Lewis Committed by Sean Christopherson

KVM: selftests: enumerate GUEST_ASSERT arguments

Enumerate GUEST_ASSERT arguments to avoid magic indices to ucall.args.
Signed-off-by: default avatarColton Lewis <coltonlewis@google.com>
Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
Link: https://lore.kernel.org/r/20220615193116.806312-2-coltonlewis@google.comSigned-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 0bc27326
...@@ -32,6 +32,14 @@ uint64_t get_ucall(struct kvm_vcpu *vcpu, struct ucall *uc); ...@@ -32,6 +32,14 @@ uint64_t get_ucall(struct kvm_vcpu *vcpu, struct ucall *uc);
ucall(UCALL_SYNC, 6, "hello", stage, arg1, arg2, arg3, arg4) ucall(UCALL_SYNC, 6, "hello", stage, arg1, arg2, arg3, arg4)
#define GUEST_SYNC(stage) ucall(UCALL_SYNC, 2, "hello", stage) #define GUEST_SYNC(stage) ucall(UCALL_SYNC, 2, "hello", stage)
#define GUEST_DONE() ucall(UCALL_DONE, 0) #define GUEST_DONE() ucall(UCALL_DONE, 0)
enum guest_assert_builtin_args {
GUEST_ERROR_STRING,
GUEST_FILE,
GUEST_LINE,
GUEST_ASSERT_BUILTIN_NARGS
};
#define __GUEST_ASSERT(_condition, _condstr, _nargs, _args...) do { \ #define __GUEST_ASSERT(_condition, _condstr, _nargs, _args...) do { \
if (!(_condition)) \ if (!(_condition)) \
ucall(UCALL_ABORT, 2 + _nargs, \ ucall(UCALL_ABORT, 2 + _nargs, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment