xref: /linux/arch/powerpc/include/asm/kvm_para.h (revision a36e9f5cfe9eb3a1dce8769c7058251c42705357)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  *
4  * Copyright IBM Corp. 2008
5  *
6  * Authors: Hollis Blanchard <hollisb@us.ibm.com>
7  */
8 #ifndef __POWERPC_KVM_PARA_H__
9 #define __POWERPC_KVM_PARA_H__
10 
11 #include <asm/kvm_guest.h>
12 
13 #include <uapi/asm/kvm_para.h>
14 
15 static inline int kvm_para_available(void)
16 {
17 	return IS_ENABLED(CONFIG_KVM_GUEST) && is_kvm_guest();
18 }
19 
20 static inline unsigned int kvm_arch_para_features(void)
21 {
22 	unsigned long r;
23 
24 	if (!kvm_para_available())
25 		return 0;
26 
27 	if(epapr_hypercall0_1(KVM_HCALL_TOKEN(KVM_HC_FEATURES), &r))
28 		return 0;
29 
30 	return r;
31 }
32 
33 static inline unsigned int kvm_arch_para_hints(void)
34 {
35 	return 0;
36 }
37 
38 static inline bool kvm_check_and_clear_guest_paused(void)
39 {
40 	return false;
41 }
42 
43 #endif /* __POWERPC_KVM_PARA_H__ */
44