diff options
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r-- | arch/powerpc/kernel/process.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 095043d79946..91e52df3d81d 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -395,6 +395,9 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
395 | struct thread_struct *new_thread, *old_thread; | 395 | struct thread_struct *new_thread, *old_thread; |
396 | unsigned long flags; | 396 | unsigned long flags; |
397 | struct task_struct *last; | 397 | struct task_struct *last; |
398 | #ifdef CONFIG_PPC_BOOK3S_64 | ||
399 | struct ppc64_tlb_batch *batch; | ||
400 | #endif | ||
398 | 401 | ||
399 | #ifdef CONFIG_SMP | 402 | #ifdef CONFIG_SMP |
400 | /* avoid complexity of lazy save/restore of fpu | 403 | /* avoid complexity of lazy save/restore of fpu |
@@ -513,7 +516,17 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
513 | old_thread->accum_tb += (current_tb - start_tb); | 516 | old_thread->accum_tb += (current_tb - start_tb); |
514 | new_thread->start_tb = current_tb; | 517 | new_thread->start_tb = current_tb; |
515 | } | 518 | } |
516 | #endif | 519 | #endif /* CONFIG_PPC64 */ |
520 | |||
521 | #ifdef CONFIG_PPC_BOOK3S_64 | ||
522 | batch = &__get_cpu_var(ppc64_tlb_batch); | ||
523 | if (batch->active) { | ||
524 | current_thread_info()->local_flags |= _TLF_LAZY_MMU; | ||
525 | if (batch->index) | ||
526 | __flush_tlb_pending(batch); | ||
527 | batch->active = 0; | ||
528 | } | ||
529 | #endif /* CONFIG_PPC_BOOK3S_64 */ | ||
517 | 530 | ||
518 | local_irq_save(flags); | 531 | local_irq_save(flags); |
519 | 532 | ||
@@ -528,6 +541,14 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
528 | hard_irq_disable(); | 541 | hard_irq_disable(); |
529 | last = _switch(old_thread, new_thread); | 542 | last = _switch(old_thread, new_thread); |
530 | 543 | ||
544 | #ifdef CONFIG_PPC_BOOK3S_64 | ||
545 | if (current_thread_info()->local_flags & _TLF_LAZY_MMU) { | ||
546 | current_thread_info()->local_flags &= ~_TLF_LAZY_MMU; | ||
547 | batch = &__get_cpu_var(ppc64_tlb_batch); | ||
548 | batch->active = 1; | ||
549 | } | ||
550 | #endif /* CONFIG_PPC_BOOK3S_64 */ | ||
551 | |||
531 | local_irq_restore(flags); | 552 | local_irq_restore(flags); |
532 | 553 | ||
533 | return last; | 554 | return last; |