Skip to content

Commit 242331d

Browse files
sean-jcbonzini
authored andcommitted
KVM: selftests: Add GUEST_SYNC[1-6] macros for synchronizing more data
Add GUEST_SYNC[1-6]() so that tests can pass the maximum amount of information supported via ucall(), without needing to resort to shared memory. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20231027182217.3615211-31-seanjc@google.com> Reviewed-by: Fuad Tabba <tabba@google.com> Tested-by: Fuad Tabba <tabba@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 672eaa3 commit 242331d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/testing/selftests/kvm/include/ucall_common.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ int ucall_nr_pages_required(uint64_t page_size);
5252
#define GUEST_SYNC_ARGS(stage, arg1, arg2, arg3, arg4) \
5353
ucall(UCALL_SYNC, 6, "hello", stage, arg1, arg2, arg3, arg4)
5454
#define GUEST_SYNC(stage) ucall(UCALL_SYNC, 2, "hello", stage)
55+
#define GUEST_SYNC1(arg0) ucall(UCALL_SYNC, 1, arg0)
56+
#define GUEST_SYNC2(arg0, arg1) ucall(UCALL_SYNC, 2, arg0, arg1)
57+
#define GUEST_SYNC3(arg0, arg1, arg2) \
58+
ucall(UCALL_SYNC, 3, arg0, arg1, arg2)
59+
#define GUEST_SYNC4(arg0, arg1, arg2, arg3) \
60+
ucall(UCALL_SYNC, 4, arg0, arg1, arg2, arg3)
61+
#define GUEST_SYNC5(arg0, arg1, arg2, arg3, arg4) \
62+
ucall(UCALL_SYNC, 5, arg0, arg1, arg2, arg3, arg4)
63+
#define GUEST_SYNC6(arg0, arg1, arg2, arg3, arg4, arg5) \
64+
ucall(UCALL_SYNC, 6, arg0, arg1, arg2, arg3, arg4, arg5)
65+
5566
#define GUEST_PRINTF(_fmt, _args...) ucall_fmt(UCALL_PRINTF, _fmt, ##_args)
5667
#define GUEST_DONE() ucall(UCALL_DONE, 0)
5768

0 commit comments

Comments
 (0)