aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ia64/kprobes.h
diff options
context:
space:
mode:
authorAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>2007-05-11 12:38:40 -0400
committerTony Luck <tony.luck@intel.com>2007-05-11 12:38:40 -0400
commitcdc7dbdfe6edac177acb32e4ca56b525d0743fe7 (patch)
tree739b21d116a24185eb1704cdcf64206043de2f20 /include/asm-ia64/kprobes.h
parent25d61578daae697c4a0eb817f42a868af9824f82 (diff)
[IA64] fix Kprobes reentrancy
In case of reentrance i.e when a probe handler calls a functions which inturn has a probe, we save a previous kprobe information and just single step the reentrant probe without calling the actual probe handler. During this reentracy period, if an interrupt occurs and if probe happens to trigger in the inturrupt path, then we were corrupting the previous kprobe( as we were overriding the previous kprobe info) info their by crashing the system. This patch fixes this issues by having a an array of previous kprobe info struct(with the array size of 2). This similar technique is not needed on i386 and x86_64 because by default interrupts are turn off in the break/int3 exception handler. Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include/asm-ia64/kprobes.h')
-rw-r--r--include/asm-ia64/kprobes.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 828ae00e47c1..2abc98b336f3 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -71,13 +71,15 @@ struct prev_kprobe {
71 71
72#define MAX_PARAM_RSE_SIZE (0x60+0x60/0x3f) 72#define MAX_PARAM_RSE_SIZE (0x60+0x60/0x3f)
73/* per-cpu kprobe control block */ 73/* per-cpu kprobe control block */
74#define ARCH_PREV_KPROBE_SZ 2
74struct kprobe_ctlblk { 75struct kprobe_ctlblk {
75 unsigned long kprobe_status; 76 unsigned long kprobe_status;
76 struct pt_regs jprobe_saved_regs; 77 struct pt_regs jprobe_saved_regs;
77 unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE]; 78 unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE];
78 unsigned long *bsp; 79 unsigned long *bsp;
79 unsigned long cfm; 80 unsigned long cfm;
80 struct prev_kprobe prev_kprobe; 81 atomic_t prev_kprobe_index;
82 struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
81}; 83};
82 84
83#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 85#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry