diff options
author | Zhang Yanmin <yanmin.zhang@intel.com> | 2006-01-13 17:45:21 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-01-13 17:45:21 -0500 |
commit | d3ef1f5aafcf7a4129eb2078c70bc9e577bc3af1 (patch) | |
tree | 619647d90b0a51d39e80bbc20b59e7e7dccbf510 /include/asm-ia64/kprobes.h | |
parent | e026cca0f2c09c4c28c902db6384fd8a412671d6 (diff) |
[IA64] prevent accidental modification of args in jprobe handler
When jprobe is hit, the function parameters of the original function
should be saved before jprobe handler is executed, and restored it after
jprobe handler is executed, because jprobe handler might change the
register values due to tail call optimization by the gcc.
Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include/asm-ia64/kprobes.h')
-rw-r--r-- | include/asm-ia64/kprobes.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index a74b68104559..8c0fc227f0fb 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h | |||
@@ -68,10 +68,14 @@ struct prev_kprobe { | |||
68 | unsigned long status; | 68 | unsigned long status; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | #define MAX_PARAM_RSE_SIZE (0x60+0x60/0x3f) | ||
71 | /* per-cpu kprobe control block */ | 72 | /* per-cpu kprobe control block */ |
72 | struct kprobe_ctlblk { | 73 | struct kprobe_ctlblk { |
73 | unsigned long kprobe_status; | 74 | unsigned long kprobe_status; |
74 | struct pt_regs jprobe_saved_regs; | 75 | struct pt_regs jprobe_saved_regs; |
76 | unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE]; | ||
77 | unsigned long *bsp; | ||
78 | unsigned long cfm; | ||
75 | struct prev_kprobe prev_kprobe; | 79 | struct prev_kprobe prev_kprobe; |
76 | }; | 80 | }; |
77 | 81 | ||
@@ -118,5 +122,7 @@ extern int kprobe_exceptions_notify(struct notifier_block *self, | |||
118 | static inline void jprobe_return(void) | 122 | static inline void jprobe_return(void) |
119 | { | 123 | { |
120 | } | 124 | } |
125 | extern void invalidate_stacked_regs(void); | ||
126 | extern void flush_register_stack(void); | ||
121 | 127 | ||
122 | #endif /* _ASM_KPROBES_H */ | 128 | #endif /* _ASM_KPROBES_H */ |