aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/processor.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-10-11 03:23:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-10-11 03:23:53 -0400
commit3ad26e5c4459d3793ad65bc8929037c70515df83 (patch)
tree434327df7942878383e372988eb5f3bccb25de12 /arch/powerpc/include/asm/processor.h
parent5293bf97a27e1be8ac6096aa198ff6a9e3e6837c (diff)
parent18461960cbf50bf345ef0667d45d5f64de8fb893 (diff)
Merge branch 'for-kvm' into next
Topic branch for commits that the KVM tree might want to pull in separately. Hand merged a few files due to conflicts with the LE stuff Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/processor.h')
-rw-r--r--arch/powerpc/include/asm/processor.h47
1 files changed, 25 insertions, 22 deletions
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 82c6ee9df9a1..c1583070937d 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -152,8 +152,20 @@ typedef struct {
152 unsigned long seg; 152 unsigned long seg;
153} mm_segment_t; 153} mm_segment_t;
154 154
155#define TS_FPR(i) fpr[i][TS_FPROFFSET] 155#define TS_FPR(i) fp_state.fpr[i][TS_FPROFFSET]
156#define TS_TRANS_FPR(i) transact_fpr[i][TS_FPROFFSET] 156#define TS_TRANS_FPR(i) transact_fp.fpr[i][TS_FPROFFSET]
157
158/* FP and VSX 0-31 register set */
159struct thread_fp_state {
160 u64 fpr[32][TS_FPRWIDTH] __attribute__((aligned(16)));
161 u64 fpscr; /* Floating point status */
162};
163
164/* Complete AltiVec register set including VSCR */
165struct thread_vr_state {
166 vector128 vr[32] __attribute__((aligned(16)));
167 vector128 vscr __attribute__((aligned(16)));
168};
157 169
158struct thread_struct { 170struct thread_struct {
159 unsigned long ksp; /* Kernel stack pointer */ 171 unsigned long ksp; /* Kernel stack pointer */
@@ -206,13 +218,8 @@ struct thread_struct {
206 unsigned long dvc2; 218 unsigned long dvc2;
207#endif 219#endif
208#endif 220#endif
209 /* FP and VSX 0-31 register set */ 221 struct thread_fp_state fp_state;
210 double fpr[32][TS_FPRWIDTH] __attribute__((aligned(16))); 222 struct thread_fp_state *fp_save_area;
211 struct {
212
213 unsigned int pad;
214 unsigned int val; /* Floating point status */
215 } fpscr;
216 int fpexc_mode; /* floating-point exception mode */ 223 int fpexc_mode; /* floating-point exception mode */
217 unsigned int align_ctl; /* alignment handling control */ 224 unsigned int align_ctl; /* alignment handling control */
218#ifdef CONFIG_PPC64 225#ifdef CONFIG_PPC64
@@ -230,10 +237,8 @@ struct thread_struct {
230 struct arch_hw_breakpoint hw_brk; /* info on the hardware breakpoint */ 237 struct arch_hw_breakpoint hw_brk; /* info on the hardware breakpoint */
231 unsigned long trap_nr; /* last trap # on this thread */ 238 unsigned long trap_nr; /* last trap # on this thread */
232#ifdef CONFIG_ALTIVEC 239#ifdef CONFIG_ALTIVEC
233 /* Complete AltiVec register set */ 240 struct thread_vr_state vr_state;
234 vector128 vr[32] __attribute__((aligned(16))); 241 struct thread_vr_state *vr_save_area;
235 /* AltiVec status */
236 vector128 vscr __attribute__((aligned(16)));
237 unsigned long vrsave; 242 unsigned long vrsave;
238 int used_vr; /* set if process has used altivec */ 243 int used_vr; /* set if process has used altivec */
239#endif /* CONFIG_ALTIVEC */ 244#endif /* CONFIG_ALTIVEC */
@@ -270,13 +275,8 @@ struct thread_struct {
270 * transact_fpr[] is the new set of transactional values. 275 * transact_fpr[] is the new set of transactional values.
271 * VRs work the same way. 276 * VRs work the same way.
272 */ 277 */
273 double transact_fpr[32][TS_FPRWIDTH]; 278 struct thread_fp_state transact_fp;
274 struct { 279 struct thread_vr_state transact_vr;
275 unsigned int pad;
276 unsigned int val; /* Floating point status */
277 } transact_fpscr;
278 vector128 transact_vr[32] __attribute__((aligned(16)));
279 vector128 transact_vscr __attribute__((aligned(16)));
280 unsigned long transact_vrsave; 280 unsigned long transact_vrsave;
281#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ 281#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
282#ifdef CONFIG_KVM_BOOK3S_32_HANDLER 282#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
@@ -330,8 +330,6 @@ struct thread_struct {
330 .ksp = INIT_SP, \ 330 .ksp = INIT_SP, \
331 .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ 331 .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
332 .fs = KERNEL_DS, \ 332 .fs = KERNEL_DS, \
333 .fpr = {{0}}, \
334 .fpscr = { .val = 0, }, \
335 .fpexc_mode = 0, \ 333 .fpexc_mode = 0, \
336 .ppr = INIT_PPR, \ 334 .ppr = INIT_PPR, \
337} 335}
@@ -369,6 +367,11 @@ extern int set_endian(struct task_struct *tsk, unsigned int val);
369extern int get_unalign_ctl(struct task_struct *tsk, unsigned long adr); 367extern int get_unalign_ctl(struct task_struct *tsk, unsigned long adr);
370extern int set_unalign_ctl(struct task_struct *tsk, unsigned int val); 368extern int set_unalign_ctl(struct task_struct *tsk, unsigned int val);
371 369
370extern void load_fp_state(struct thread_fp_state *fp);
371extern void store_fp_state(struct thread_fp_state *fp);
372extern void load_vr_state(struct thread_vr_state *vr);
373extern void store_vr_state(struct thread_vr_state *vr);
374
372static inline unsigned int __unpack_fe01(unsigned long msr_bits) 375static inline unsigned int __unpack_fe01(unsigned long msr_bits)
373{ 376{
374 return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); 377 return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8);