diff options
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/kvm.h | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s.h | 8 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 15 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_ppc.h | 10 | ||||
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 1 |
5 files changed, 30 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h index 471bb3d85e0b..a4f6c85431f8 100644 --- a/arch/powerpc/include/asm/kvm.h +++ b/arch/powerpc/include/asm/kvm.h | |||
@@ -282,4 +282,9 @@ struct kvm_create_spapr_tce { | |||
282 | __u32 window_size; | 282 | __u32 window_size; |
283 | }; | 283 | }; |
284 | 284 | ||
285 | /* for KVM_ALLOCATE_RMA */ | ||
286 | struct kvm_allocate_rma { | ||
287 | __u64 rma_size; | ||
288 | }; | ||
289 | |||
285 | #endif /* __LINUX_KVM_POWERPC_H */ | 290 | #endif /* __LINUX_KVM_POWERPC_H */ |
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index 5537c45d626c..3f91ebd4ae43 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
@@ -298,14 +298,6 @@ static inline unsigned long kvmppc_interrupt_offset(struct kvm_vcpu *vcpu) | |||
298 | static inline void kvmppc_update_int_pending(struct kvm_vcpu *vcpu, | 298 | static inline void kvmppc_update_int_pending(struct kvm_vcpu *vcpu, |
299 | unsigned long pending_now, unsigned long old_pending) | 299 | unsigned long pending_now, unsigned long old_pending) |
300 | { | 300 | { |
301 | /* Recalculate LPCR:MER based on the presence of | ||
302 | * a pending external interrupt | ||
303 | */ | ||
304 | if (test_bit(BOOK3S_IRQPRIO_EXTERNAL, &pending_now) || | ||
305 | test_bit(BOOK3S_IRQPRIO_EXTERNAL_LEVEL, &pending_now)) | ||
306 | vcpu->arch.lpcr |= LPCR_MER; | ||
307 | else | ||
308 | vcpu->arch.lpcr &= ~((u64)LPCR_MER); | ||
309 | } | 301 | } |
310 | 302 | ||
311 | static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) | 303 | static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) |
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 0d6d569e19c7..f572d9cc31bd 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/threads.h> | 28 | #include <linux/threads.h> |
29 | #include <linux/spinlock.h> | 29 | #include <linux/spinlock.h> |
30 | #include <linux/kvm_para.h> | 30 | #include <linux/kvm_para.h> |
31 | #include <linux/list.h> | ||
32 | #include <linux/atomic.h> | ||
31 | #include <asm/kvm_asm.h> | 33 | #include <asm/kvm_asm.h> |
32 | #include <asm/processor.h> | 34 | #include <asm/processor.h> |
33 | 35 | ||
@@ -156,6 +158,14 @@ struct kvmppc_spapr_tce_table { | |||
156 | struct page *pages[0]; | 158 | struct page *pages[0]; |
157 | }; | 159 | }; |
158 | 160 | ||
161 | struct kvmppc_rma_info { | ||
162 | void *base_virt; | ||
163 | unsigned long base_pfn; | ||
164 | unsigned long npages; | ||
165 | struct list_head list; | ||
166 | atomic_t use_count; | ||
167 | }; | ||
168 | |||
159 | struct kvm_arch { | 169 | struct kvm_arch { |
160 | #ifdef CONFIG_KVM_BOOK3S_64_HV | 170 | #ifdef CONFIG_KVM_BOOK3S_64_HV |
161 | unsigned long hpt_virt; | 171 | unsigned long hpt_virt; |
@@ -169,6 +179,10 @@ struct kvm_arch { | |||
169 | unsigned long sdr1; | 179 | unsigned long sdr1; |
170 | unsigned long host_sdr1; | 180 | unsigned long host_sdr1; |
171 | int tlbie_lock; | 181 | int tlbie_lock; |
182 | int n_rma_pages; | ||
183 | unsigned long lpcr; | ||
184 | unsigned long rmor; | ||
185 | struct kvmppc_rma_info *rma; | ||
172 | struct list_head spapr_tce_tables; | 186 | struct list_head spapr_tce_tables; |
173 | unsigned short last_vcpu[NR_CPUS]; | 187 | unsigned short last_vcpu[NR_CPUS]; |
174 | struct kvmppc_vcore *vcores[KVM_MAX_VCORES]; | 188 | struct kvmppc_vcore *vcores[KVM_MAX_VCORES]; |
@@ -295,7 +309,6 @@ struct kvm_vcpu_arch { | |||
295 | ulong guest_owned_ext; | 309 | ulong guest_owned_ext; |
296 | ulong purr; | 310 | ulong purr; |
297 | ulong spurr; | 311 | ulong spurr; |
298 | ulong lpcr; | ||
299 | ulong dscr; | 312 | ulong dscr; |
300 | ulong amr; | 313 | ulong amr; |
301 | ulong uamor; | 314 | ulong uamor; |
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index 6ef734428634..d121f49d62b8 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h | |||
@@ -124,6 +124,10 @@ extern void kvmppc_map_vrma(struct kvm *kvm, | |||
124 | extern int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu); | 124 | extern int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu); |
125 | extern long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm, | 125 | extern long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm, |
126 | struct kvm_create_spapr_tce *args); | 126 | struct kvm_create_spapr_tce *args); |
127 | extern long kvm_vm_ioctl_allocate_rma(struct kvm *kvm, | ||
128 | struct kvm_allocate_rma *rma); | ||
129 | extern struct kvmppc_rma_info *kvm_alloc_rma(void); | ||
130 | extern void kvm_release_rma(struct kvmppc_rma_info *ri); | ||
127 | extern int kvmppc_core_init_vm(struct kvm *kvm); | 131 | extern int kvmppc_core_init_vm(struct kvm *kvm); |
128 | extern void kvmppc_core_destroy_vm(struct kvm *kvm); | 132 | extern void kvmppc_core_destroy_vm(struct kvm *kvm); |
129 | extern int kvmppc_core_prepare_memory_region(struct kvm *kvm, | 133 | extern int kvmppc_core_prepare_memory_region(struct kvm *kvm, |
@@ -177,9 +181,15 @@ static inline void kvmppc_set_xics_phys(int cpu, unsigned long addr) | |||
177 | { | 181 | { |
178 | paca[cpu].kvm_hstate.xics_phys = addr; | 182 | paca[cpu].kvm_hstate.xics_phys = addr; |
179 | } | 183 | } |
184 | |||
185 | extern void kvm_rma_init(void); | ||
186 | |||
180 | #else | 187 | #else |
181 | static inline void kvmppc_set_xics_phys(int cpu, unsigned long addr) | 188 | static inline void kvmppc_set_xics_phys(int cpu, unsigned long addr) |
182 | {} | 189 | {} |
190 | |||
191 | static inline void kvm_rma_init(void) | ||
192 | {} | ||
183 | #endif | 193 | #endif |
184 | 194 | ||
185 | #endif /* __POWERPC_KVM_PPC_H__ */ | 195 | #endif /* __POWERPC_KVM_PPC_H__ */ |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 36a611b398c5..20a053c14270 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -242,6 +242,7 @@ | |||
242 | #define LPCR_VRMA_LP1 (1ul << (63-16)) | 242 | #define LPCR_VRMA_LP1 (1ul << (63-16)) |
243 | #define LPCR_VRMASD_SH (63-16) | 243 | #define LPCR_VRMASD_SH (63-16) |
244 | #define LPCR_RMLS 0x1C000000 /* impl dependent rmo limit sel */ | 244 | #define LPCR_RMLS 0x1C000000 /* impl dependent rmo limit sel */ |
245 | #define LPCR_RMLS_SH (63-37) | ||
245 | #define LPCR_ILE 0x02000000 /* !HV irqs set MSR:LE */ | 246 | #define LPCR_ILE 0x02000000 /* !HV irqs set MSR:LE */ |
246 | #define LPCR_PECE 0x00007000 /* powersave exit cause enable */ | 247 | #define LPCR_PECE 0x00007000 /* powersave exit cause enable */ |
247 | #define LPCR_PECE0 0x00004000 /* ext. exceptions can cause exit */ | 248 | #define LPCR_PECE0 0x00004000 /* ext. exceptions can cause exit */ |