aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 8a1b001d0b11..7949c203cb89 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -354,6 +354,14 @@ static void show_instructions(struct pt_regs *regs)
354 if (!(i % 8)) 354 if (!(i % 8))
355 printk("\n"); 355 printk("\n");
356 356
357#if !defined(CONFIG_BOOKE)
358 /* If executing with the IMMU off, adjust pc rather
359 * than print XXXXXXXX.
360 */
361 if (!(regs->msr & MSR_IR))
362 pc = (unsigned long)phys_to_virt(pc);
363#endif
364
357 /* We use __get_user here *only* to avoid an OOPS on a 365 /* We use __get_user here *only* to avoid an OOPS on a
358 * bad address because the pc *should* only be a 366 * bad address because the pc *should* only be a
359 * kernel address. 367 * kernel address.
@@ -556,10 +564,15 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
556 564
557#ifdef CONFIG_PPC64 565#ifdef CONFIG_PPC64
558 if (cpu_has_feature(CPU_FTR_SLB)) { 566 if (cpu_has_feature(CPU_FTR_SLB)) {
559 unsigned long sp_vsid = get_kernel_vsid(sp); 567 unsigned long sp_vsid;
560 unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp; 568 unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp;
561 569
562 sp_vsid <<= SLB_VSID_SHIFT; 570 if (cpu_has_feature(CPU_FTR_1T_SEGMENT))
571 sp_vsid = get_kernel_vsid(sp, MMU_SEGSIZE_1T)
572 << SLB_VSID_SHIFT_1T;
573 else
574 sp_vsid = get_kernel_vsid(sp, MMU_SEGSIZE_256M)
575 << SLB_VSID_SHIFT;
563 sp_vsid |= SLB_VSID_KERNEL | llp; 576 sp_vsid |= SLB_VSID_KERNEL | llp;
564 p->thread.ksp_vsid = sp_vsid; 577 p->thread.ksp_vsid = sp_vsid;
565 } 578 }
@@ -676,9 +689,13 @@ int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
676 * mode (asyn, precise, disabled) for 'Classic' FP. */ 689 * mode (asyn, precise, disabled) for 'Classic' FP. */
677 if (val & PR_FP_EXC_SW_ENABLE) { 690 if (val & PR_FP_EXC_SW_ENABLE) {
678#ifdef CONFIG_SPE 691#ifdef CONFIG_SPE
679 tsk->thread.fpexc_mode = val & 692 if (cpu_has_feature(CPU_FTR_SPE)) {
680 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT); 693 tsk->thread.fpexc_mode = val &
681 return 0; 694 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT);
695 return 0;
696 } else {
697 return -EINVAL;
698 }
682#else 699#else
683 return -EINVAL; 700 return -EINVAL;
684#endif 701#endif
@@ -704,7 +721,10 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
704 721
705 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) 722 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE)
706#ifdef CONFIG_SPE 723#ifdef CONFIG_SPE
707 val = tsk->thread.fpexc_mode; 724 if (cpu_has_feature(CPU_FTR_SPE))
725 val = tsk->thread.fpexc_mode;
726 else
727 return -EINVAL;
708#else 728#else
709 return -EINVAL; 729 return -EINVAL;
710#endif 730#endif