aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kvm_ppc.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/kvm_ppc.h')
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index 9345238edecf..d121f49d62b8 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -33,6 +33,9 @@
33#else 33#else
34#include <asm/kvm_booke.h> 34#include <asm/kvm_booke.h>
35#endif 35#endif
36#ifdef CONFIG_KVM_BOOK3S_64_HANDLER
37#include <asm/paca.h>
38#endif
36 39
37enum emulation_result { 40enum emulation_result {
38 EMULATE_DONE, /* no further processing */ 41 EMULATE_DONE, /* no further processing */
@@ -42,6 +45,7 @@ enum emulation_result {
42 EMULATE_AGAIN, /* something went wrong. go again */ 45 EMULATE_AGAIN, /* something went wrong. go again */
43}; 46};
44 47
48extern int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu);
45extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu); 49extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu);
46extern char kvmppc_handlers_start[]; 50extern char kvmppc_handlers_start[];
47extern unsigned long kvmppc_handler_len; 51extern unsigned long kvmppc_handler_len;
@@ -109,6 +113,27 @@ extern void kvmppc_booke_exit(void);
109 113
110extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); 114extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu);
111extern int kvmppc_kvm_pv(struct kvm_vcpu *vcpu); 115extern int kvmppc_kvm_pv(struct kvm_vcpu *vcpu);
116extern void kvmppc_map_magic(struct kvm_vcpu *vcpu);
117
118extern long kvmppc_alloc_hpt(struct kvm *kvm);
119extern void kvmppc_free_hpt(struct kvm *kvm);
120extern long kvmppc_prepare_vrma(struct kvm *kvm,
121 struct kvm_userspace_memory_region *mem);
122extern void kvmppc_map_vrma(struct kvm *kvm,
123 struct kvm_userspace_memory_region *mem);
124extern int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu);
125extern long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
126 struct kvm_create_spapr_tce *args);
127extern long kvm_vm_ioctl_allocate_rma(struct kvm *kvm,
128 struct kvm_allocate_rma *rma);
129extern struct kvmppc_rma_info *kvm_alloc_rma(void);
130extern void kvm_release_rma(struct kvmppc_rma_info *ri);
131extern int kvmppc_core_init_vm(struct kvm *kvm);
132extern void kvmppc_core_destroy_vm(struct kvm *kvm);
133extern int kvmppc_core_prepare_memory_region(struct kvm *kvm,
134 struct kvm_userspace_memory_region *mem);
135extern void kvmppc_core_commit_memory_region(struct kvm *kvm,
136 struct kvm_userspace_memory_region *mem);
112 137
113/* 138/*
114 * Cuts out inst bits with ordering according to spec. 139 * Cuts out inst bits with ordering according to spec.
@@ -151,4 +176,20 @@ int kvmppc_set_sregs_ivor(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
151 176
152void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 pid); 177void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 pid);
153 178
179#ifdef CONFIG_KVM_BOOK3S_64_HV
180static inline void kvmppc_set_xics_phys(int cpu, unsigned long addr)
181{
182 paca[cpu].kvm_hstate.xics_phys = addr;
183}
184
185extern void kvm_rma_init(void);
186
187#else
188static inline void kvmppc_set_xics_phys(int cpu, unsigned long addr)
189{}
190
191static inline void kvm_rma_init(void)
192{}
193#endif
194
154#endif /* __POWERPC_KVM_PPC_H__ */ 195#endif /* __POWERPC_KVM_PPC_H__ */