forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/arm64/kernel/probes/uprobes.c
....@@ -1,9 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2014-2016 Pratyush Anand <panand@redhat.com>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 */
85 #include <linux/highmem.h>
96 #include <linux/ptrace.h>
....@@ -171,7 +168,7 @@
171168 static int uprobe_breakpoint_handler(struct pt_regs *regs,
172169 unsigned int esr)
173170 {
174
- if (user_mode(regs) && uprobe_pre_sstep_notifier(regs))
171
+ if (uprobe_pre_sstep_notifier(regs))
175172 return DBG_HOOK_HANDLED;
176173
177174 return DBG_HOOK_ERROR;
....@@ -182,21 +179,16 @@
182179 {
183180 struct uprobe_task *utask = current->utask;
184181
185
- if (user_mode(regs)) {
186
- WARN_ON(utask &&
187
- (instruction_pointer(regs) != utask->xol_vaddr + 4));
188
-
189
- if (uprobe_post_sstep_notifier(regs))
190
- return DBG_HOOK_HANDLED;
191
- }
182
+ WARN_ON(utask && (instruction_pointer(regs) != utask->xol_vaddr + 4));
183
+ if (uprobe_post_sstep_notifier(regs))
184
+ return DBG_HOOK_HANDLED;
192185
193186 return DBG_HOOK_ERROR;
194187 }
195188
196189 /* uprobe breakpoint handler hook */
197190 static struct break_hook uprobes_break_hook = {
198
- .esr_mask = BRK64_ESR_MASK,
199
- .esr_val = BRK64_ESR_UPROBES,
191
+ .imm = UPROBES_BRK_IMM,
200192 .fn = uprobe_breakpoint_handler,
201193 };
202194
....@@ -207,8 +199,8 @@
207199
208200 static int __init arch_init_uprobes(void)
209201 {
210
- register_break_hook(&uprobes_break_hook);
211
- register_step_hook(&uprobes_step_hook);
202
+ register_user_break_hook(&uprobes_break_hook);
203
+ register_user_step_hook(&uprobes_step_hook);
212204
213205 return 0;
214206 }