treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / powerpc / include / asm / kvm_para.h
blob9c1f6b4b9bbf478cd45645f97f8aaa09731338b2
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
4 * Copyright IBM Corp. 2008
6 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
7 */
8 #ifndef __POWERPC_KVM_PARA_H__
9 #define __POWERPC_KVM_PARA_H__
11 #include <uapi/asm/kvm_para.h>
13 #ifdef CONFIG_KVM_GUEST
15 #include <linux/of.h>
17 static inline int kvm_para_available(void)
19 struct device_node *hyper_node;
21 hyper_node = of_find_node_by_path("/hypervisor");
22 if (!hyper_node)
23 return 0;
25 if (!of_device_is_compatible(hyper_node, "linux,kvm"))
26 return 0;
28 return 1;
31 #else
33 static inline int kvm_para_available(void)
35 return 0;
38 #endif
40 static inline unsigned int kvm_arch_para_features(void)
42 unsigned long r;
44 if (!kvm_para_available())
45 return 0;
47 if(epapr_hypercall0_1(KVM_HCALL_TOKEN(KVM_HC_FEATURES), &r))
48 return 0;
50 return r;
53 static inline unsigned int kvm_arch_para_hints(void)
55 return 0;
58 static inline bool kvm_check_and_clear_guest_paused(void)
60 return false;
63 #endif /* __POWERPC_KVM_PARA_H__ */