]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/powerpc/include/asm/kvm_para.h
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 * Copyright IBM Corp. 2008
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
19 #ifndef __POWERPC_KVM_PARA_H__
20 #define __POWERPC_KVM_PARA_H__
22 #include <uapi/asm/kvm_para.h>
25 #ifdef CONFIG_KVM_GUEST
29 static inline int kvm_para_available(void)
31 struct device_node
*hyper_node
;
33 hyper_node
= of_find_node_by_path("/hypervisor");
37 if (!of_device_is_compatible(hyper_node
, "linux,kvm"))
43 extern unsigned long kvm_hypercall(unsigned long *in
,
49 static inline int kvm_para_available(void)
54 static unsigned long kvm_hypercall(unsigned long *in
,
58 return HC_EV_UNIMPLEMENTED
;
63 static inline long kvm_hypercall0_1(unsigned int nr
, unsigned long *r2
)
69 r
= kvm_hypercall(in
, out
, nr
| HC_VENDOR_KVM
);
75 static inline long kvm_hypercall0(unsigned int nr
)
80 return kvm_hypercall(in
, out
, nr
| HC_VENDOR_KVM
);
83 static inline long kvm_hypercall1(unsigned int nr
, unsigned long p1
)
89 return kvm_hypercall(in
, out
, nr
| HC_VENDOR_KVM
);
92 static inline long kvm_hypercall2(unsigned int nr
, unsigned long p1
,
100 return kvm_hypercall(in
, out
, nr
| HC_VENDOR_KVM
);
103 static inline long kvm_hypercall3(unsigned int nr
, unsigned long p1
,
104 unsigned long p2
, unsigned long p3
)
107 unsigned long out
[8];
112 return kvm_hypercall(in
, out
, nr
| HC_VENDOR_KVM
);
115 static inline long kvm_hypercall4(unsigned int nr
, unsigned long p1
,
116 unsigned long p2
, unsigned long p3
,
120 unsigned long out
[8];
126 return kvm_hypercall(in
, out
, nr
| HC_VENDOR_KVM
);
130 static inline unsigned int kvm_arch_para_features(void)
134 if (!kvm_para_available())
137 if(kvm_hypercall0_1(KVM_HC_FEATURES
, &r
))
143 static inline bool kvm_check_and_clear_guest_paused(void)
148 #endif /* __POWERPC_KVM_PARA_H__ */