forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/ia64/kernel/ftrace.c
....@@ -108,7 +108,7 @@
108108 goto skip_check;
109109
110110 /* read the text we want to modify */
111
- if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE))
111
+ if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE))
112112 return -EFAULT;
113113
114114 /* Make sure it is what we expect it to be */
....@@ -117,7 +117,7 @@
117117
118118 skip_check:
119119 /* replace the text with the new text */
120
- if (probe_kernel_write(((void *)ip), new_code, MCOUNT_INSN_SIZE))
120
+ if (copy_to_kernel_nofault(((void *)ip), new_code, MCOUNT_INSN_SIZE))
121121 return -EPERM;
122122 flush_icache_range(ip, ip + MCOUNT_INSN_SIZE);
123123
....@@ -129,7 +129,7 @@
129129 unsigned char __attribute__((aligned(8))) replaced[MCOUNT_INSN_SIZE];
130130 unsigned long ip = rec->ip;
131131
132
- if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE))
132
+ if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE))
133133 return -EFAULT;
134134 if (rec->flags & FTRACE_FL_CONVERTED) {
135135 struct ftrace_call_insn *call_insn, *tmp_call;