xref: /linux/tools/testing/selftests/kvm/include/aarch64/ucall.h (revision d53b8e36925256097a08d7cb749198d85cbf9b2b)
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.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