diff options
Diffstat (limited to 'arch/powerpc/kernel/process.c')
| -rw-r--r-- | arch/powerpc/kernel/process.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index ceb4e7b62cf4..a902723fdc69 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
| @@ -339,6 +339,13 @@ static void set_debug_reg_defaults(struct thread_struct *thread) | |||
| 339 | 339 | ||
| 340 | static void prime_debug_regs(struct thread_struct *thread) | 340 | static void prime_debug_regs(struct thread_struct *thread) |
| 341 | { | 341 | { |
| 342 | /* | ||
| 343 | * We could have inherited MSR_DE from userspace, since | ||
| 344 | * it doesn't get cleared on exception entry. Make sure | ||
| 345 | * MSR_DE is clear before we enable any debug events. | ||
| 346 | */ | ||
| 347 | mtmsr(mfmsr() & ~MSR_DE); | ||
| 348 | |||
| 342 | mtspr(SPRN_IAC1, thread->iac1); | 349 | mtspr(SPRN_IAC1, thread->iac1); |
| 343 | mtspr(SPRN_IAC2, thread->iac2); | 350 | mtspr(SPRN_IAC2, thread->iac2); |
| 344 | #if CONFIG_PPC_ADV_DEBUG_IACS > 2 | 351 | #if CONFIG_PPC_ADV_DEBUG_IACS > 2 |
| @@ -971,6 +978,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
| 971 | * do some house keeping and then return from the fork or clone | 978 | * do some house keeping and then return from the fork or clone |
| 972 | * system call, using the stack frame created above. | 979 | * system call, using the stack frame created above. |
| 973 | */ | 980 | */ |
| 981 | ((unsigned long *)sp)[0] = 0; | ||
| 974 | sp -= sizeof(struct pt_regs); | 982 | sp -= sizeof(struct pt_regs); |
| 975 | kregs = (struct pt_regs *) sp; | 983 | kregs = (struct pt_regs *) sp; |
| 976 | sp -= STACK_FRAME_OVERHEAD; | 984 | sp -= STACK_FRAME_OVERHEAD; |
