xref: /linux/tools/testing/selftests/kvm/include/aarch64/ucall.h (revision 42874e4eb35bdfc54f8514685e50434098ba4f6c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef SELFTEST_KVM_UCALL_H
3 #define SELFTEST_KVM_UCALL_H
4 
5 #include "kvm_util_base.h"
6 
7 #define UCALL_EXIT_REASON       KVM_EXIT_MMIO
8 
9 /*
10  * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each
11  * VM), it must not be accessed from host code.
12  */
13 extern vm_vaddr_t *ucall_exit_mmio_addr;
14 
15 static inline void ucall_arch_do_ucall(vm_vaddr_t uc)
16 {
17 	WRITE_ONCE(*ucall_exit_mmio_addr, uc);
18 }
19 
20 #endif
21