25 #include <linux/hw_breakpoint.h>
29 #include <linux/kernel.h>
30 #include <linux/sched.h>
34 #include <asm/hw_breakpoint.h>
35 #include <asm/processor.h>
37 #include <asm/uaccess.h>
75 if (
current->thread.last_hit_ubp != bp)
95 WARN_ONCE(1,
"Can't find the breakpoint");
114 if (bp->ctx && bp->ctx->task)
115 bp->ctx->task->thread.last_hit_ubp =
NULL;
134 case DABR_DATA_WRITE:
137 case (DABR_DATA_WRITE | DABR_DATA_READ):
157 switch (bp->
attr.bp_type) {
159 info->
type = DABR_DATA_READ;
162 info->
type = DABR_DATA_WRITE;
165 info->
type = (DABR_DATA_READ | DABR_DATA_WRITE);
173 info->dabrx = DABRX_ALL;
174 if (bp->
attr.exclude_user)
175 info->dabrx &= ~DABRX_USER;
176 if (bp->
attr.exclude_kernel)
177 info->dabrx &= ~DABRX_KERNEL;
178 if (bp->
attr.exclude_hv)
179 info->dabrx &= ~DABRX_HYP;
188 (HW_BREAKPOINT_LEN - (info->
address & HW_BREAKPOINT_ALIGN)))
205 info = counter_arch_bp(tsk->
thread.last_hit_ubp);
206 regs->
msr &= ~MSR_SE;
216 int rc = NOTIFY_STOP;
222 unsigned long dar = regs->
dar;
238 info = counter_arch_bp(bp);
247 perf_bp_event(bp, regs);
258 info->extraneous_interrupt = !((bp->
attr.bp_addr <=
dar) &&
259 (dar - bp->
attr.bp_addr < bp->
attr.bp_len));
263 current->thread.last_hit_ubp = bp;
270 if (!__get_user_inatomic(instr, (
unsigned int *) regs->
nip))
279 WARN(1,
"Unable to handle hardware breakpoint. Breakpoint at "
280 "0x%lx will be disabled.", info->
address);
288 if (!info->extraneous_interrupt)
289 perf_bp_event(bp, regs);
306 bp =
current->thread.last_hit_ubp;
314 info = counter_arch_bp(bp);
320 if (!info->extraneous_interrupt)
321 perf_bp_event(bp, regs);
342 int ret = NOTIFY_DONE;