aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/machine_kexec_64.c
diff options
context:
space:
mode:
authorK.Prasad <prasad@linux.vnet.ibm.com>2010-06-15 02:05:19 -0400
committerPaul Mackerras <paulus@samba.org>2010-06-22 05:40:50 -0400
commit5aae8a53708025d4e718f0d2e7c2f766779ddc71 (patch)
treed151e2c29e78248cee620cf5094a15316abd17d2 /arch/powerpc/kernel/machine_kexec_64.c
parentf7136c5150c29846d7a1d09109449d96b2f63445 (diff)
powerpc, hw_breakpoints: Implement hw_breakpoints for 64-bit server processors
Implement perf-events based hw-breakpoint interfaces for PowerPC 64-bit server (Book III S) processors. This allows access to a given location to be used as an event that can be counted or profiled by the perf_events subsystem. This is done using the DABR (data breakpoint register), which can also be used for process debugging via ptrace. When perf_event hw_breakpoint support is configured in, the perf_event subsystem manages the DABR and arbitrates access to it, and ptrace then creates a perf_event when it is requested to set a data breakpoint. [Adopted suggestions from Paul Mackerras <paulus@samba.org> to - emulate_step() all system-wide breakpoints and single-step only the per-task breakpoints - perform arch-specific cleanup before unregistration through arch_unregister_hw_breakpoint() ] Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/machine_kexec_64.c')
-rw-r--r--arch/powerpc/kernel/machine_kexec_64.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 26f9900f773c..6c7c546aa1be 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -25,6 +25,7 @@
25#include <asm/sections.h> /* _end */ 25#include <asm/sections.h> /* _end */
26#include <asm/prom.h> 26#include <asm/prom.h>
27#include <asm/smp.h> 27#include <asm/smp.h>
28#include <asm/hw_breakpoint.h>
28 29
29int default_machine_kexec_prepare(struct kimage *image) 30int default_machine_kexec_prepare(struct kimage *image)
30{ 31{
@@ -165,6 +166,7 @@ static void kexec_smp_down(void *arg)
165 while(kexec_all_irq_disabled == 0) 166 while(kexec_all_irq_disabled == 0)
166 cpu_relax(); 167 cpu_relax();
167 mb(); /* make sure all irqs are disabled before this */ 168 mb(); /* make sure all irqs are disabled before this */
169 hw_breakpoint_disable();
168 /* 170 /*
169 * Now every CPU has IRQs off, we can clear out any pending 171 * Now every CPU has IRQs off, we can clear out any pending
170 * IPIs and be sure that no more will come in after this. 172 * IPIs and be sure that no more will come in after this.
@@ -180,6 +182,7 @@ static void kexec_prepare_cpus_wait(int wait_state)
180{ 182{
181 int my_cpu, i, notified=-1; 183 int my_cpu, i, notified=-1;
182 184
185 hw_breakpoint_disable();
183 my_cpu = get_cpu(); 186 my_cpu = get_cpu();
184 /* Make sure each CPU has atleast made it to the state we need */ 187 /* Make sure each CPU has atleast made it to the state we need */
185 for (i=0; i < NR_CPUS; i++) { 188 for (i=0; i < NR_CPUS; i++) {