diff options
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/compat.h | 3 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm.h | 13 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s.h | 40 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s_asm.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 30 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_ppc.h | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/qe.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/systbl.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/udbg.h | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/unistd.h | 4 |
10 files changed, 80 insertions, 18 deletions
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index 91010e8f847..88e602f6430 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h | |||
@@ -100,7 +100,8 @@ struct compat_statfs { | |||
100 | compat_fsid_t f_fsid; | 100 | compat_fsid_t f_fsid; |
101 | int f_namelen; /* SunOS ignores this field. */ | 101 | int f_namelen; /* SunOS ignores this field. */ |
102 | int f_frsize; | 102 | int f_frsize; |
103 | int f_spare[5]; | 103 | int f_flags; |
104 | int f_spare[4]; | ||
104 | }; | 105 | }; |
105 | 106 | ||
106 | #define COMPAT_RLIM_OLD_INFINITY 0x7fffffff | 107 | #define COMPAT_RLIM_OLD_INFINITY 0x7fffffff |
diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h index a4f6c85431f..08fe69edcd1 100644 --- a/arch/powerpc/include/asm/kvm.h +++ b/arch/powerpc/include/asm/kvm.h | |||
@@ -149,6 +149,12 @@ struct kvm_regs { | |||
149 | #define KVM_SREGS_E_UPDATE_DBSR (1 << 3) | 149 | #define KVM_SREGS_E_UPDATE_DBSR (1 << 3) |
150 | 150 | ||
151 | /* | 151 | /* |
152 | * Book3S special bits to indicate contents in the struct by maintaining | ||
153 | * backwards compatibility with older structs. If adding a new field, | ||
154 | * please make sure to add a flag for that new field */ | ||
155 | #define KVM_SREGS_S_HIOR (1 << 0) | ||
156 | |||
157 | /* | ||
152 | * In KVM_SET_SREGS, reserved/pad fields must be left untouched from a | 158 | * In KVM_SET_SREGS, reserved/pad fields must be left untouched from a |
153 | * previous KVM_GET_REGS. | 159 | * previous KVM_GET_REGS. |
154 | * | 160 | * |
@@ -173,6 +179,8 @@ struct kvm_sregs { | |||
173 | __u64 ibat[8]; | 179 | __u64 ibat[8]; |
174 | __u64 dbat[8]; | 180 | __u64 dbat[8]; |
175 | } ppc32; | 181 | } ppc32; |
182 | __u64 flags; /* KVM_SREGS_S_ */ | ||
183 | __u64 hior; | ||
176 | } s; | 184 | } s; |
177 | struct { | 185 | struct { |
178 | union { | 186 | union { |
@@ -276,6 +284,11 @@ struct kvm_guest_debug_arch { | |||
276 | #define KVM_INTERRUPT_UNSET -2U | 284 | #define KVM_INTERRUPT_UNSET -2U |
277 | #define KVM_INTERRUPT_SET_LEVEL -3U | 285 | #define KVM_INTERRUPT_SET_LEVEL -3U |
278 | 286 | ||
287 | #define KVM_CPU_440 1 | ||
288 | #define KVM_CPU_E500V2 2 | ||
289 | #define KVM_CPU_3S_32 3 | ||
290 | #define KVM_CPU_3S_64 4 | ||
291 | |||
279 | /* for KVM_CAP_SPAPR_TCE */ | 292 | /* for KVM_CAP_SPAPR_TCE */ |
280 | struct kvm_create_spapr_tce { | 293 | struct kvm_create_spapr_tce { |
281 | __u64 liobn; | 294 | __u64 liobn; |
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index 98da010252a..a384ffdf33d 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
@@ -90,6 +90,8 @@ struct kvmppc_vcpu_book3s { | |||
90 | #endif | 90 | #endif |
91 | int context_id[SID_CONTEXTS]; | 91 | int context_id[SID_CONTEXTS]; |
92 | 92 | ||
93 | bool hior_sregs; /* HIOR is set by SREGS, not PVR */ | ||
94 | |||
93 | struct hlist_head hpte_hash_pte[HPTEG_HASH_NUM_PTE]; | 95 | struct hlist_head hpte_hash_pte[HPTEG_HASH_NUM_PTE]; |
94 | struct hlist_head hpte_hash_pte_long[HPTEG_HASH_NUM_PTE_LONG]; | 96 | struct hlist_head hpte_hash_pte_long[HPTEG_HASH_NUM_PTE_LONG]; |
95 | struct hlist_head hpte_hash_vpte[HPTEG_HASH_NUM_VPTE]; | 97 | struct hlist_head hpte_hash_vpte[HPTEG_HASH_NUM_VPTE]; |
@@ -139,15 +141,14 @@ extern void kvmppc_giveup_ext(struct kvm_vcpu *vcpu, ulong msr); | |||
139 | extern int kvmppc_emulate_paired_single(struct kvm_run *run, struct kvm_vcpu *vcpu); | 141 | extern int kvmppc_emulate_paired_single(struct kvm_run *run, struct kvm_vcpu *vcpu); |
140 | extern pfn_t kvmppc_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn); | 142 | extern pfn_t kvmppc_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn); |
141 | 143 | ||
142 | extern void kvmppc_handler_lowmem_trampoline(void); | 144 | extern void kvmppc_entry_trampoline(void); |
143 | extern void kvmppc_handler_trampoline_enter(void); | ||
144 | extern void kvmppc_rmcall(ulong srr0, ulong srr1); | ||
145 | extern void kvmppc_hv_entry_trampoline(void); | 145 | extern void kvmppc_hv_entry_trampoline(void); |
146 | extern void kvmppc_load_up_fpu(void); | 146 | extern void kvmppc_load_up_fpu(void); |
147 | extern void kvmppc_load_up_altivec(void); | 147 | extern void kvmppc_load_up_altivec(void); |
148 | extern void kvmppc_load_up_vsx(void); | 148 | extern void kvmppc_load_up_vsx(void); |
149 | extern u32 kvmppc_alignment_dsisr(struct kvm_vcpu *vcpu, unsigned int inst); | 149 | extern u32 kvmppc_alignment_dsisr(struct kvm_vcpu *vcpu, unsigned int inst); |
150 | extern ulong kvmppc_alignment_dar(struct kvm_vcpu *vcpu, unsigned int inst); | 150 | extern ulong kvmppc_alignment_dar(struct kvm_vcpu *vcpu, unsigned int inst); |
151 | extern int kvmppc_h_pr(struct kvm_vcpu *vcpu, unsigned long cmd); | ||
151 | 152 | ||
152 | static inline struct kvmppc_vcpu_book3s *to_book3s(struct kvm_vcpu *vcpu) | 153 | static inline struct kvmppc_vcpu_book3s *to_book3s(struct kvm_vcpu *vcpu) |
153 | { | 154 | { |
@@ -382,6 +383,39 @@ static inline bool kvmppc_critical_section(struct kvm_vcpu *vcpu) | |||
382 | } | 383 | } |
383 | #endif | 384 | #endif |
384 | 385 | ||
386 | static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r, | ||
387 | unsigned long pte_index) | ||
388 | { | ||
389 | unsigned long rb, va_low; | ||
390 | |||
391 | rb = (v & ~0x7fUL) << 16; /* AVA field */ | ||
392 | va_low = pte_index >> 3; | ||
393 | if (v & HPTE_V_SECONDARY) | ||
394 | va_low = ~va_low; | ||
395 | /* xor vsid from AVA */ | ||
396 | if (!(v & HPTE_V_1TB_SEG)) | ||
397 | va_low ^= v >> 12; | ||
398 | else | ||
399 | va_low ^= v >> 24; | ||
400 | va_low &= 0x7ff; | ||
401 | if (v & HPTE_V_LARGE) { | ||
402 | rb |= 1; /* L field */ | ||
403 | if (cpu_has_feature(CPU_FTR_ARCH_206) && | ||
404 | (r & 0xff000)) { | ||
405 | /* non-16MB large page, must be 64k */ | ||
406 | /* (masks depend on page size) */ | ||
407 | rb |= 0x1000; /* page encoding in LP field */ | ||
408 | rb |= (va_low & 0x7f) << 16; /* 7b of VA in AVA/LP field */ | ||
409 | rb |= (va_low & 0xfe); /* AVAL field (P7 doesn't seem to care) */ | ||
410 | } | ||
411 | } else { | ||
412 | /* 4kB page */ | ||
413 | rb |= (va_low & 0x7ff) << 12; /* remaining 11b of VA */ | ||
414 | } | ||
415 | rb |= (v >> 54) & 0x300; /* B field */ | ||
416 | return rb; | ||
417 | } | ||
418 | |||
385 | /* Magic register values loaded into r3 and r4 before the 'sc' assembly | 419 | /* Magic register values loaded into r3 and r4 before the 'sc' assembly |
386 | * instruction for the OSI hypercalls */ | 420 | * instruction for the OSI hypercalls */ |
387 | #define OSI_SC_MAGIC_R3 0x113724FA | 421 | #define OSI_SC_MAGIC_R3 0x113724FA |
diff --git a/arch/powerpc/include/asm/kvm_book3s_asm.h b/arch/powerpc/include/asm/kvm_book3s_asm.h index ef7b3688c3b..1f2f5b6156b 100644 --- a/arch/powerpc/include/asm/kvm_book3s_asm.h +++ b/arch/powerpc/include/asm/kvm_book3s_asm.h | |||
@@ -75,6 +75,8 @@ struct kvmppc_host_state { | |||
75 | ulong scratch0; | 75 | ulong scratch0; |
76 | ulong scratch1; | 76 | ulong scratch1; |
77 | u8 in_guest; | 77 | u8 in_guest; |
78 | u8 restore_hid5; | ||
79 | u8 napping; | ||
78 | 80 | ||
79 | #ifdef CONFIG_KVM_BOOK3S_64_HV | 81 | #ifdef CONFIG_KVM_BOOK3S_64_HV |
80 | struct kvm_vcpu *kvm_vcpu; | 82 | struct kvm_vcpu *kvm_vcpu; |
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index cc22b282d75..bf8af5d5d5d 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -198,21 +198,29 @@ struct kvm_arch { | |||
198 | */ | 198 | */ |
199 | struct kvmppc_vcore { | 199 | struct kvmppc_vcore { |
200 | int n_runnable; | 200 | int n_runnable; |
201 | int n_blocked; | 201 | int n_busy; |
202 | int num_threads; | 202 | int num_threads; |
203 | int entry_exit_count; | 203 | int entry_exit_count; |
204 | int n_woken; | 204 | int n_woken; |
205 | int nap_count; | 205 | int nap_count; |
206 | int napping_threads; | ||
206 | u16 pcpu; | 207 | u16 pcpu; |
207 | u8 vcore_running; | 208 | u8 vcore_state; |
208 | u8 in_guest; | 209 | u8 in_guest; |
209 | struct list_head runnable_threads; | 210 | struct list_head runnable_threads; |
210 | spinlock_t lock; | 211 | spinlock_t lock; |
212 | wait_queue_head_t wq; | ||
211 | }; | 213 | }; |
212 | 214 | ||
213 | #define VCORE_ENTRY_COUNT(vc) ((vc)->entry_exit_count & 0xff) | 215 | #define VCORE_ENTRY_COUNT(vc) ((vc)->entry_exit_count & 0xff) |
214 | #define VCORE_EXIT_COUNT(vc) ((vc)->entry_exit_count >> 8) | 216 | #define VCORE_EXIT_COUNT(vc) ((vc)->entry_exit_count >> 8) |
215 | 217 | ||
218 | /* Values for vcore_state */ | ||
219 | #define VCORE_INACTIVE 0 | ||
220 | #define VCORE_RUNNING 1 | ||
221 | #define VCORE_EXITING 2 | ||
222 | #define VCORE_SLEEPING 3 | ||
223 | |||
216 | struct kvmppc_pte { | 224 | struct kvmppc_pte { |
217 | ulong eaddr; | 225 | ulong eaddr; |
218 | u64 vpage; | 226 | u64 vpage; |
@@ -258,14 +266,6 @@ struct kvm_vcpu_arch { | |||
258 | ulong host_stack; | 266 | ulong host_stack; |
259 | u32 host_pid; | 267 | u32 host_pid; |
260 | #ifdef CONFIG_PPC_BOOK3S | 268 | #ifdef CONFIG_PPC_BOOK3S |
261 | ulong host_msr; | ||
262 | ulong host_r2; | ||
263 | void *host_retip; | ||
264 | ulong trampoline_lowmem; | ||
265 | ulong trampoline_enter; | ||
266 | ulong highmem_handler; | ||
267 | ulong rmcall; | ||
268 | ulong host_paca_phys; | ||
269 | struct kvmppc_slb slb[64]; | 269 | struct kvmppc_slb slb[64]; |
270 | int slb_max; /* 1 + index of last valid entry in slb[] */ | 270 | int slb_max; /* 1 + index of last valid entry in slb[] */ |
271 | int slb_nr; /* total number of entries in SLB */ | 271 | int slb_nr; /* total number of entries in SLB */ |
@@ -389,6 +389,9 @@ struct kvm_vcpu_arch { | |||
389 | u8 dcr_is_write; | 389 | u8 dcr_is_write; |
390 | u8 osi_needed; | 390 | u8 osi_needed; |
391 | u8 osi_enabled; | 391 | u8 osi_enabled; |
392 | u8 papr_enabled; | ||
393 | u8 sane; | ||
394 | u8 cpu_type; | ||
392 | u8 hcall_needed; | 395 | u8 hcall_needed; |
393 | 396 | ||
394 | u32 cpr0_cfgaddr; /* holds the last set cpr0_cfgaddr */ | 397 | u32 cpr0_cfgaddr; /* holds the last set cpr0_cfgaddr */ |
@@ -408,11 +411,13 @@ struct kvm_vcpu_arch { | |||
408 | struct dtl *dtl; | 411 | struct dtl *dtl; |
409 | struct dtl *dtl_end; | 412 | struct dtl *dtl_end; |
410 | 413 | ||
414 | wait_queue_head_t *wqp; | ||
411 | struct kvmppc_vcore *vcore; | 415 | struct kvmppc_vcore *vcore; |
412 | int ret; | 416 | int ret; |
413 | int trap; | 417 | int trap; |
414 | int state; | 418 | int state; |
415 | int ptid; | 419 | int ptid; |
420 | bool timer_running; | ||
416 | wait_queue_head_t cpu_run; | 421 | wait_queue_head_t cpu_run; |
417 | 422 | ||
418 | struct kvm_vcpu_arch_shared *shared; | 423 | struct kvm_vcpu_arch_shared *shared; |
@@ -428,8 +433,9 @@ struct kvm_vcpu_arch { | |||
428 | #endif | 433 | #endif |
429 | }; | 434 | }; |
430 | 435 | ||
431 | #define KVMPPC_VCPU_BUSY_IN_HOST 0 | 436 | /* Values for vcpu->arch.state */ |
432 | #define KVMPPC_VCPU_BLOCKED 1 | 437 | #define KVMPPC_VCPU_STOPPED 0 |
438 | #define KVMPPC_VCPU_BUSY_IN_HOST 1 | ||
433 | #define KVMPPC_VCPU_RUNNABLE 2 | 439 | #define KVMPPC_VCPU_RUNNABLE 2 |
434 | 440 | ||
435 | #endif /* __POWERPC_KVM_HOST_H__ */ | 441 | #endif /* __POWERPC_KVM_HOST_H__ */ |
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index d121f49d62b..46efd1a265c 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h | |||
@@ -66,6 +66,7 @@ extern int kvmppc_emulate_instruction(struct kvm_run *run, | |||
66 | extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu); | 66 | extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu); |
67 | extern void kvmppc_emulate_dec(struct kvm_vcpu *vcpu); | 67 | extern void kvmppc_emulate_dec(struct kvm_vcpu *vcpu); |
68 | extern u32 kvmppc_get_dec(struct kvm_vcpu *vcpu, u64 tb); | 68 | extern u32 kvmppc_get_dec(struct kvm_vcpu *vcpu, u64 tb); |
69 | extern int kvmppc_sanity_check(struct kvm_vcpu *vcpu); | ||
69 | 70 | ||
70 | /* Core-specific hooks */ | 71 | /* Core-specific hooks */ |
71 | 72 | ||
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h index 0947b36e534..5e0b6d511e1 100644 --- a/arch/powerpc/include/asm/qe.h +++ b/arch/powerpc/include/asm/qe.h | |||
@@ -196,7 +196,7 @@ static inline int qe_alive_during_sleep(void) | |||
196 | 196 | ||
197 | /* Structure that defines QE firmware binary files. | 197 | /* Structure that defines QE firmware binary files. |
198 | * | 198 | * |
199 | * See Documentation/powerpc/qe-firmware.txt for a description of these | 199 | * See Documentation/powerpc/qe_firmware.txt for a description of these |
200 | * fields. | 200 | * fields. |
201 | */ | 201 | */ |
202 | struct qe_firmware { | 202 | struct qe_firmware { |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index fa0d27a400d..559ae1ee670 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -354,3 +354,5 @@ COMPAT_SYS_SPU(clock_adjtime) | |||
354 | SYSCALL_SPU(syncfs) | 354 | SYSCALL_SPU(syncfs) |
355 | COMPAT_SYS_SPU(sendmmsg) | 355 | COMPAT_SYS_SPU(sendmmsg) |
356 | SYSCALL_SPU(setns) | 356 | SYSCALL_SPU(setns) |
357 | COMPAT_SYS(process_vm_readv) | ||
358 | COMPAT_SYS(process_vm_writev) | ||
diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h index 6587ec7bc6e..8338aef5a4d 100644 --- a/arch/powerpc/include/asm/udbg.h +++ b/arch/powerpc/include/asm/udbg.h | |||
@@ -54,6 +54,7 @@ extern void __init udbg_init_40x_realmode(void); | |||
54 | extern void __init udbg_init_cpm(void); | 54 | extern void __init udbg_init_cpm(void); |
55 | extern void __init udbg_init_usbgecko(void); | 55 | extern void __init udbg_init_usbgecko(void); |
56 | extern void __init udbg_init_wsp(void); | 56 | extern void __init udbg_init_wsp(void); |
57 | extern void __init udbg_init_ehv_bc(void); | ||
57 | extern void __init udbg_init_ps3gelic(void); | 58 | extern void __init udbg_init_ps3gelic(void); |
58 | extern void __init udbg_init_debug_opal_raw(void); | 59 | extern void __init udbg_init_debug_opal_raw(void); |
59 | extern void __init udbg_init_debug_opal_hvsi(void); | 60 | extern void __init udbg_init_debug_opal_hvsi(void); |
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index b8b3f599362..d3d1b5efd7e 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
@@ -373,10 +373,12 @@ | |||
373 | #define __NR_syncfs 348 | 373 | #define __NR_syncfs 348 |
374 | #define __NR_sendmmsg 349 | 374 | #define __NR_sendmmsg 349 |
375 | #define __NR_setns 350 | 375 | #define __NR_setns 350 |
376 | #define __NR_process_vm_readv 351 | ||
377 | #define __NR_process_vm_writev 352 | ||
376 | 378 | ||
377 | #ifdef __KERNEL__ | 379 | #ifdef __KERNEL__ |
378 | 380 | ||
379 | #define __NR_syscalls 351 | 381 | #define __NR_syscalls 353 |
380 | 382 | ||
381 | #define __NR__exit __NR_exit | 383 | #define __NR__exit __NR_exit |
382 | #define NR_syscalls __NR_syscalls | 384 | #define NR_syscalls __NR_syscalls |