| .. | .. |
|---|
| 7 | 7 | #ifndef CONFIG_DYNAMIC_FTRACE |
|---|
| 8 | 8 | extern void (*ftrace_trace_function)(unsigned long, unsigned long, |
|---|
| 9 | 9 | struct ftrace_ops*, struct pt_regs*); |
|---|
| 10 | | -extern int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace); |
|---|
| 11 | 10 | extern void ftrace_graph_caller(void); |
|---|
| 12 | 11 | |
|---|
| 13 | 12 | noinline void __naked ftrace_stub(unsigned long ip, unsigned long parent_ip, |
|---|
| .. | .. |
|---|
| 90 | 89 | return 0; |
|---|
| 91 | 90 | } |
|---|
| 92 | 91 | |
|---|
| 93 | | -int ftrace_arch_code_modify_prepare(void) |
|---|
| 94 | | -{ |
|---|
| 95 | | - set_all_modules_text_rw(); |
|---|
| 96 | | - return 0; |
|---|
| 97 | | -} |
|---|
| 98 | | - |
|---|
| 99 | | -int ftrace_arch_code_modify_post_process(void) |
|---|
| 100 | | -{ |
|---|
| 101 | | - set_all_modules_text_ro(); |
|---|
| 102 | | - return 0; |
|---|
| 103 | | -} |
|---|
| 104 | | - |
|---|
| 105 | 92 | static unsigned long gen_sethi_insn(unsigned long addr) |
|---|
| 106 | 93 | { |
|---|
| 107 | 94 | unsigned long opcode = 0x46000000; |
|---|
| .. | .. |
|---|
| 144 | 131 | unsigned long orig_insn[3]; |
|---|
| 145 | 132 | |
|---|
| 146 | 133 | if (validate) { |
|---|
| 147 | | - if (probe_kernel_read(orig_insn, (void *)pc, MCOUNT_INSN_SIZE)) |
|---|
| 134 | + if (copy_from_kernel_nofault(orig_insn, (void *)pc, |
|---|
| 135 | + MCOUNT_INSN_SIZE)) |
|---|
| 148 | 136 | return -EFAULT; |
|---|
| 149 | 137 | if (memcmp(orig_insn, old_insn, MCOUNT_INSN_SIZE)) |
|---|
| 150 | 138 | return -EINVAL; |
|---|
| 151 | 139 | } |
|---|
| 152 | 140 | |
|---|
| 153 | | - if (probe_kernel_write((void *)pc, new_insn, MCOUNT_INSN_SIZE)) |
|---|
| 141 | + if (copy_to_kernel_nofault((void *)pc, new_insn, MCOUNT_INSN_SIZE)) |
|---|
| 154 | 142 | return -EPERM; |
|---|
| 155 | 143 | |
|---|
| 156 | 144 | return 0; |
|---|