kprobes.c (9f90b997de4efd5404a8c52f89c400f0f4e2d216) | kprobes.c (1eeb66a1bb973534dc3d064920a5ca683823372e) |
---|---|
1/* 2 * Kernel Probes (KProbes) 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 16 unchanged lines hidden (view full) --- 25 * 2004-Nov Ananth N Mavinakayanahalli <ananth@in.ibm.com> kprobes port 26 * for PPC64 27 */ 28 29#include <linux/kprobes.h> 30#include <linux/ptrace.h> 31#include <linux/preempt.h> 32#include <linux/module.h> | 1/* 2 * Kernel Probes (KProbes) 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 16 unchanged lines hidden (view full) --- 25 * 2004-Nov Ananth N Mavinakayanahalli <ananth@in.ibm.com> kprobes port 26 * for PPC64 27 */ 28 29#include <linux/kprobes.h> 30#include <linux/ptrace.h> 31#include <linux/preempt.h> 32#include <linux/module.h> |
33#include <linux/kdebug.h> |
|
33#include <asm/cacheflush.h> | 34#include <asm/cacheflush.h> |
34#include <asm/kdebug.h> | |
35#include <asm/sstep.h> 36#include <asm/uaccess.h> 37 38DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 39DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 40 41int __kprobes arch_prepare_kprobe(struct kprobe *p) 42{ --- 362 unchanged lines hidden (view full) --- 405 * of do_debug, as if this is not a probe hit. 406 */ 407 if (regs->msr & MSR_SE) 408 return 0; 409 410 return 1; 411} 412 | 35#include <asm/sstep.h> 36#include <asm/uaccess.h> 37 38DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 39DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 40 41int __kprobes arch_prepare_kprobe(struct kprobe *p) 42{ --- 362 unchanged lines hidden (view full) --- 405 * of do_debug, as if this is not a probe hit. 406 */ 407 if (regs->msr & MSR_SE) 408 return 0; 409 410 return 1; 411} 412 |
413int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | 413static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) |
414{ 415 struct kprobe *cur = kprobe_running(); 416 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 417 const struct exception_table_entry *entry; 418 419 switch(kcb->kprobe_status) { 420 case KPROBE_HIT_SS: 421 case KPROBE_REENTER: --- 68 unchanged lines hidden (view full) --- 490 case DIE_BPT: 491 if (kprobe_handler(args->regs)) 492 ret = NOTIFY_STOP; 493 break; 494 case DIE_SSTEP: 495 if (post_kprobe_handler(args->regs)) 496 ret = NOTIFY_STOP; 497 break; | 414{ 415 struct kprobe *cur = kprobe_running(); 416 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 417 const struct exception_table_entry *entry; 418 419 switch(kcb->kprobe_status) { 420 case KPROBE_HIT_SS: 421 case KPROBE_REENTER: --- 68 unchanged lines hidden (view full) --- 490 case DIE_BPT: 491 if (kprobe_handler(args->regs)) 492 ret = NOTIFY_STOP; 493 break; 494 case DIE_SSTEP: 495 if (post_kprobe_handler(args->regs)) 496 ret = NOTIFY_STOP; 497 break; |
498 case DIE_PAGE_FAULT: 499 /* kprobe_running() needs smp_processor_id() */ 500 preempt_disable(); 501 if (kprobe_running() && 502 kprobe_fault_handler(args->regs, args->trapnr)) 503 ret = NOTIFY_STOP; 504 preempt_enable(); 505 break; |
|
498 default: 499 break; 500 } 501 return ret; 502} 503 504int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 505{ --- 48 unchanged lines hidden --- | 506 default: 507 break; 508 } 509 return ret; 510} 511 512int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 513{ --- 48 unchanged lines hidden --- |