.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * 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. |
---|
17 | 4 | * |
---|
18 | 5 | * Copyright IBM Corporation, 2007-2012 |
---|
19 | 6 | * |
---|
.. | .. |
---|
27 | 14 | #include <linux/kdebug.h> |
---|
28 | 15 | |
---|
29 | 16 | #include <asm/sstep.h> |
---|
| 17 | +#include <asm/inst.h> |
---|
30 | 18 | |
---|
31 | 19 | #define UPROBE_TRAP_NR UINT_MAX |
---|
32 | 20 | |
---|
.. | .. |
---|
124 | 112 | * support doesn't exist and have to fix-up the next instruction |
---|
125 | 113 | * to be executed. |
---|
126 | 114 | */ |
---|
127 | | - regs->nip = utask->vaddr + MAX_UINSN_BYTES; |
---|
| 115 | + regs->nip = (unsigned long)ppc_inst_next((void *)utask->vaddr, &auprobe->insn); |
---|
128 | 116 | |
---|
129 | 117 | user_disable_single_step(current); |
---|
130 | 118 | return 0; |
---|
.. | .. |
---|
186 | 174 | * emulate_step() returns 1 if the insn was successfully emulated. |
---|
187 | 175 | * For all other cases, we need to single-step in hardware. |
---|
188 | 176 | */ |
---|
189 | | - ret = emulate_step(regs, auprobe->insn); |
---|
| 177 | + ret = emulate_step(regs, ppc_inst_read(&auprobe->insn)); |
---|
190 | 178 | if (ret > 0) |
---|
191 | 179 | return true; |
---|
192 | 180 | |
---|