forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/arch/powerpc/kernel/uprobes.c
....@@ -1,19 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * User-space Probes (UProbes) for powerpc
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 as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, write to the Free Software
16
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
174 *
185 * Copyright IBM Corporation, 2007-2012
196 *
....@@ -27,6 +14,7 @@
2714 #include <linux/kdebug.h>
2815
2916 #include <asm/sstep.h>
17
+#include <asm/inst.h>
3018
3119 #define UPROBE_TRAP_NR UINT_MAX
3220
....@@ -124,7 +112,7 @@
124112 * support doesn't exist and have to fix-up the next instruction
125113 * to be executed.
126114 */
127
- regs->nip = utask->vaddr + MAX_UINSN_BYTES;
115
+ regs->nip = (unsigned long)ppc_inst_next((void *)utask->vaddr, &auprobe->insn);
128116
129117 user_disable_single_step(current);
130118 return 0;
....@@ -186,7 +174,7 @@
186174 * emulate_step() returns 1 if the insn was successfully emulated.
187175 * For all other cases, we need to single-step in hardware.
188176 */
189
- ret = emulate_step(regs, auprobe->insn);
177
+ ret = emulate_step(regs, ppc_inst_read(&auprobe->insn));
190178 if (ret > 0)
191179 return true;
192180