diff options
-rw-r--r-- | arch/ia64/kernel/kprobes.c | 18 | ||||
-rw-r--r-- | arch/ia64/kernel/vmlinux.lds.S | 7 | ||||
-rw-r--r-- | include/asm-ia64/sections.h | 1 |
3 files changed, 23 insertions, 3 deletions
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index ec2ceade12b0..3aa3167edbec 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
36 | #include <asm/kdebug.h> | 36 | #include <asm/kdebug.h> |
37 | #include <asm/sections.h> | ||
37 | 38 | ||
38 | extern void jprobe_inst_return(void); | 39 | extern void jprobe_inst_return(void); |
39 | 40 | ||
@@ -263,14 +264,27 @@ static inline void get_kprobe_inst(bundle_t *bundle, uint slot, | |||
263 | } | 264 | } |
264 | } | 265 | } |
265 | 266 | ||
267 | /* Returns non-zero if the addr is in the Interrupt Vector Table */ | ||
268 | static inline int in_ivt_functions(unsigned long addr) | ||
269 | { | ||
270 | return (addr >= (unsigned long)__start_ivt_text | ||
271 | && addr < (unsigned long)__end_ivt_text); | ||
272 | } | ||
273 | |||
266 | static int valid_kprobe_addr(int template, int slot, unsigned long addr) | 274 | static int valid_kprobe_addr(int template, int slot, unsigned long addr) |
267 | { | 275 | { |
268 | if ((slot > 2) || ((bundle_encoding[template][1] == L) && slot > 1)) { | 276 | if ((slot > 2) || ((bundle_encoding[template][1] == L) && slot > 1)) { |
269 | printk(KERN_WARNING "Attempting to insert unaligned kprobe at 0x%lx\n", | 277 | printk(KERN_WARNING "Attempting to insert unaligned kprobe " |
270 | addr); | 278 | "at 0x%lx\n", addr); |
271 | return -EINVAL; | 279 | return -EINVAL; |
272 | } | 280 | } |
273 | 281 | ||
282 | if (in_ivt_functions(addr)) { | ||
283 | printk(KERN_WARNING "Kprobes can't be inserted inside " | ||
284 | "IVT functions at 0x%lx\n", addr); | ||
285 | return -EINVAL; | ||
286 | } | ||
287 | |||
274 | if (slot == 1 && bundle_encoding[template][1] != L) { | 288 | if (slot == 1 && bundle_encoding[template][1] != L) { |
275 | printk(KERN_WARNING "Inserting kprobes on slot #1 " | 289 | printk(KERN_WARNING "Inserting kprobes on slot #1 " |
276 | "is not supported\n"); | 290 | "is not supported\n"); |
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index b9f0db4c1b04..a676e79e0681 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S | |||
@@ -8,6 +8,11 @@ | |||
8 | #define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE) | 8 | #define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE) |
9 | #include <asm-generic/vmlinux.lds.h> | 9 | #include <asm-generic/vmlinux.lds.h> |
10 | 10 | ||
11 | #define IVT_TEXT \ | ||
12 | VMLINUX_SYMBOL(__start_ivt_text) = .; \ | ||
13 | *(.text.ivt) \ | ||
14 | VMLINUX_SYMBOL(__end_ivt_text) = .; | ||
15 | |||
11 | OUTPUT_FORMAT("elf64-ia64-little") | 16 | OUTPUT_FORMAT("elf64-ia64-little") |
12 | OUTPUT_ARCH(ia64) | 17 | OUTPUT_ARCH(ia64) |
13 | ENTRY(phys_start) | 18 | ENTRY(phys_start) |
@@ -39,7 +44,7 @@ SECTIONS | |||
39 | 44 | ||
40 | .text : AT(ADDR(.text) - LOAD_OFFSET) | 45 | .text : AT(ADDR(.text) - LOAD_OFFSET) |
41 | { | 46 | { |
42 | *(.text.ivt) | 47 | IVT_TEXT |
43 | *(.text) | 48 | *(.text) |
44 | SCHED_TEXT | 49 | SCHED_TEXT |
45 | LOCK_TEXT | 50 | LOCK_TEXT |
diff --git a/include/asm-ia64/sections.h b/include/asm-ia64/sections.h index 8e3dbde1b429..e9eb7f62d32b 100644 --- a/include/asm-ia64/sections.h +++ b/include/asm-ia64/sections.h | |||
@@ -17,6 +17,7 @@ extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[]; | |||
17 | extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[]; | 17 | extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[]; |
18 | extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[]; | 18 | extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[]; |
19 | extern char __start_unwind[], __end_unwind[]; | 19 | extern char __start_unwind[], __end_unwind[]; |
20 | extern char __start_ivt_text[], __end_ivt_text[]; | ||
20 | 21 | ||
21 | #endif /* _ASM_IA64_SECTIONS_H */ | 22 | #endif /* _ASM_IA64_SECTIONS_H */ |
22 | 23 | ||