diff options
Diffstat (limited to 'arch/s390/kernel/process.c')
-rw-r--r-- | arch/s390/kernel/process.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index c5dbb335716d..7ed0d4e2a435 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -139,7 +139,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp, | |||
139 | if (unlikely(p->flags & PF_KTHREAD)) { | 139 | if (unlikely(p->flags & PF_KTHREAD)) { |
140 | /* kernel thread */ | 140 | /* kernel thread */ |
141 | memset(&frame->childregs, 0, sizeof(struct pt_regs)); | 141 | memset(&frame->childregs, 0, sizeof(struct pt_regs)); |
142 | frame->childregs.psw.mask = psw_kernel_bits | PSW_MASK_DAT | | 142 | frame->childregs.psw.mask = PSW_KERNEL_BITS | PSW_MASK_DAT | |
143 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK; | 143 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK; |
144 | frame->childregs.psw.addr = PSW_ADDR_AMODE | | 144 | frame->childregs.psw.addr = PSW_ADDR_AMODE | |
145 | (unsigned long) kernel_thread_starter; | 145 | (unsigned long) kernel_thread_starter; |
@@ -165,7 +165,8 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp, | |||
165 | * save fprs to current->thread.fp_regs to merge them with | 165 | * save fprs to current->thread.fp_regs to merge them with |
166 | * the emulated registers and then copy the result to the child. | 166 | * the emulated registers and then copy the result to the child. |
167 | */ | 167 | */ |
168 | save_fp_regs(¤t->thread.fp_regs); | 168 | save_fp_ctl(¤t->thread.fp_regs.fpc); |
169 | save_fp_regs(current->thread.fp_regs.fprs); | ||
169 | memcpy(&p->thread.fp_regs, ¤t->thread.fp_regs, | 170 | memcpy(&p->thread.fp_regs, ¤t->thread.fp_regs, |
170 | sizeof(s390_fp_regs)); | 171 | sizeof(s390_fp_regs)); |
171 | /* Set a new TLS ? */ | 172 | /* Set a new TLS ? */ |
@@ -173,7 +174,9 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp, | |||
173 | p->thread.acrs[0] = frame->childregs.gprs[6]; | 174 | p->thread.acrs[0] = frame->childregs.gprs[6]; |
174 | #else /* CONFIG_64BIT */ | 175 | #else /* CONFIG_64BIT */ |
175 | /* Save the fpu registers to new thread structure. */ | 176 | /* Save the fpu registers to new thread structure. */ |
176 | save_fp_regs(&p->thread.fp_regs); | 177 | save_fp_ctl(&p->thread.fp_regs.fpc); |
178 | save_fp_regs(p->thread.fp_regs.fprs); | ||
179 | p->thread.fp_regs.pad = 0; | ||
177 | /* Set a new TLS ? */ | 180 | /* Set a new TLS ? */ |
178 | if (clone_flags & CLONE_SETTLS) { | 181 | if (clone_flags & CLONE_SETTLS) { |
179 | unsigned long tls = frame->childregs.gprs[6]; | 182 | unsigned long tls = frame->childregs.gprs[6]; |
@@ -205,10 +208,12 @@ int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs) | |||
205 | * save fprs to current->thread.fp_regs to merge them with | 208 | * save fprs to current->thread.fp_regs to merge them with |
206 | * the emulated registers and then copy the result to the dump. | 209 | * the emulated registers and then copy the result to the dump. |
207 | */ | 210 | */ |
208 | save_fp_regs(¤t->thread.fp_regs); | 211 | save_fp_ctl(¤t->thread.fp_regs.fpc); |
212 | save_fp_regs(current->thread.fp_regs.fprs); | ||
209 | memcpy(fpregs, ¤t->thread.fp_regs, sizeof(s390_fp_regs)); | 213 | memcpy(fpregs, ¤t->thread.fp_regs, sizeof(s390_fp_regs)); |
210 | #else /* CONFIG_64BIT */ | 214 | #else /* CONFIG_64BIT */ |
211 | save_fp_regs(fpregs); | 215 | save_fp_ctl(&fpregs->fpc); |
216 | save_fp_regs(fpregs->fprs); | ||
212 | #endif /* CONFIG_64BIT */ | 217 | #endif /* CONFIG_64BIT */ |
213 | return 1; | 218 | return 1; |
214 | } | 219 | } |