diff options
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r-- | arch/powerpc/kernel/process.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 773424df828a..1e78453645be 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/kernel_stat.h> | 37 | #include <linux/kernel_stat.h> |
38 | #include <linux/personality.h> | 38 | #include <linux/personality.h> |
39 | #include <linux/random.h> | 39 | #include <linux/random.h> |
40 | #include <linux/hw_breakpoint.h> | ||
40 | 41 | ||
41 | #include <asm/pgtable.h> | 42 | #include <asm/pgtable.h> |
42 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
@@ -462,8 +463,14 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
462 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS | 463 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS |
463 | switch_booke_debug_regs(&new->thread); | 464 | switch_booke_debug_regs(&new->thread); |
464 | #else | 465 | #else |
466 | /* | ||
467 | * For PPC_BOOK3S_64, we use the hw-breakpoint interfaces that would | ||
468 | * schedule DABR | ||
469 | */ | ||
470 | #ifndef CONFIG_HAVE_HW_BREAKPOINT | ||
465 | if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) | 471 | if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) |
466 | set_dabr(new->thread.dabr); | 472 | set_dabr(new->thread.dabr); |
473 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
467 | #endif | 474 | #endif |
468 | 475 | ||
469 | 476 | ||
@@ -642,7 +649,11 @@ void flush_thread(void) | |||
642 | { | 649 | { |
643 | discard_lazy_cpu_state(); | 650 | discard_lazy_cpu_state(); |
644 | 651 | ||
652 | #ifdef CONFIG_HAVE_HW_BREAKPOINTS | ||
653 | flush_ptrace_hw_breakpoint(current); | ||
654 | #else /* CONFIG_HAVE_HW_BREAKPOINTS */ | ||
645 | set_debug_reg_defaults(¤t->thread); | 655 | set_debug_reg_defaults(¤t->thread); |
656 | #endif /* CONFIG_HAVE_HW_BREAKPOINTS */ | ||
646 | } | 657 | } |
647 | 658 | ||
648 | void | 659 | void |
@@ -660,6 +671,9 @@ void prepare_to_copy(struct task_struct *tsk) | |||
660 | flush_altivec_to_thread(current); | 671 | flush_altivec_to_thread(current); |
661 | flush_vsx_to_thread(current); | 672 | flush_vsx_to_thread(current); |
662 | flush_spe_to_thread(current); | 673 | flush_spe_to_thread(current); |
674 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
675 | flush_ptrace_hw_breakpoint(tsk); | ||
676 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
663 | } | 677 | } |
664 | 678 | ||
665 | /* | 679 | /* |