diff options
Diffstat (limited to 'arch/powerpc/kernel/signal_32.c')
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index d3f0b6d452fb..177bba78fb0b 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -497,6 +497,15 @@ static long restore_user_regs(struct pt_regs *regs, | |||
497 | if (err) | 497 | if (err) |
498 | return 1; | 498 | return 1; |
499 | 499 | ||
500 | /* | ||
501 | * Do this before updating the thread state in | ||
502 | * current->thread.fpr/vr/evr. That way, if we get preempted | ||
503 | * and another task grabs the FPU/Altivec/SPE, it won't be | ||
504 | * tempted to save the current CPU state into the thread_struct | ||
505 | * and corrupt what we are writing there. | ||
506 | */ | ||
507 | discard_lazy_cpu_state(); | ||
508 | |||
500 | /* force the process to reload the FP registers from | 509 | /* force the process to reload the FP registers from |
501 | current->thread when it next does FP instructions */ | 510 | current->thread when it next does FP instructions */ |
502 | regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); | 511 | regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); |
@@ -538,18 +547,6 @@ static long restore_user_regs(struct pt_regs *regs, | |||
538 | return 1; | 547 | return 1; |
539 | #endif /* CONFIG_SPE */ | 548 | #endif /* CONFIG_SPE */ |
540 | 549 | ||
541 | #ifndef CONFIG_SMP | ||
542 | preempt_disable(); | ||
543 | if (last_task_used_math == current) | ||
544 | last_task_used_math = NULL; | ||
545 | if (last_task_used_altivec == current) | ||
546 | last_task_used_altivec = NULL; | ||
547 | #ifdef CONFIG_SPE | ||
548 | if (last_task_used_spe == current) | ||
549 | last_task_used_spe = NULL; | ||
550 | #endif | ||
551 | preempt_enable(); | ||
552 | #endif | ||
553 | return 0; | 550 | return 0; |
554 | } | 551 | } |
555 | 552 | ||