diff options
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r-- | arch/powerpc/kernel/process.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index f74f355a9617..095043d79946 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -702,6 +702,8 @@ void prepare_to_copy(struct task_struct *tsk) | |||
702 | /* | 702 | /* |
703 | * Copy a thread.. | 703 | * Copy a thread.. |
704 | */ | 704 | */ |
705 | extern unsigned long dscr_default; /* defined in arch/powerpc/kernel/sysfs.c */ | ||
706 | |||
705 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 707 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
706 | unsigned long unused, struct task_struct *p, | 708 | unsigned long unused, struct task_struct *p, |
707 | struct pt_regs *regs) | 709 | struct pt_regs *regs) |
@@ -755,11 +757,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
755 | _ALIGN_UP(sizeof(struct thread_info), 16); | 757 | _ALIGN_UP(sizeof(struct thread_info), 16); |
756 | 758 | ||
757 | #ifdef CONFIG_PPC_STD_MMU_64 | 759 | #ifdef CONFIG_PPC_STD_MMU_64 |
758 | if (cpu_has_feature(CPU_FTR_SLB)) { | 760 | if (mmu_has_feature(MMU_FTR_SLB)) { |
759 | unsigned long sp_vsid; | 761 | unsigned long sp_vsid; |
760 | unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp; | 762 | unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp; |
761 | 763 | ||
762 | if (cpu_has_feature(CPU_FTR_1T_SEGMENT)) | 764 | if (mmu_has_feature(MMU_FTR_1T_SEGMENT)) |
763 | sp_vsid = get_kernel_vsid(sp, MMU_SEGSIZE_1T) | 765 | sp_vsid = get_kernel_vsid(sp, MMU_SEGSIZE_1T) |
764 | << SLB_VSID_SHIFT_1T; | 766 | << SLB_VSID_SHIFT_1T; |
765 | else | 767 | else |
@@ -769,6 +771,20 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
769 | p->thread.ksp_vsid = sp_vsid; | 771 | p->thread.ksp_vsid = sp_vsid; |
770 | } | 772 | } |
771 | #endif /* CONFIG_PPC_STD_MMU_64 */ | 773 | #endif /* CONFIG_PPC_STD_MMU_64 */ |
774 | #ifdef CONFIG_PPC64 | ||
775 | if (cpu_has_feature(CPU_FTR_DSCR)) { | ||
776 | if (current->thread.dscr_inherit) { | ||
777 | p->thread.dscr_inherit = 1; | ||
778 | p->thread.dscr = current->thread.dscr; | ||
779 | } else if (0 != dscr_default) { | ||
780 | p->thread.dscr_inherit = 1; | ||
781 | p->thread.dscr = dscr_default; | ||
782 | } else { | ||
783 | p->thread.dscr_inherit = 0; | ||
784 | p->thread.dscr = 0; | ||
785 | } | ||
786 | } | ||
787 | #endif | ||
772 | 788 | ||
773 | /* | 789 | /* |
774 | * The PPC64 ABI makes use of a TOC to contain function | 790 | * The PPC64 ABI makes use of a TOC to contain function |