summaryrefslogtreecommitdiff
path: root/arch/powerpc/lib/test_emulate_step.c
diff options
context:
space:
mode:
authorJordan Niethe <jniethe5@gmail.com>2020-05-06 13:40:27 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-19 00:10:36 +1000
commit777e26f0edf8dab58b8dd474d35d83bde0ac6d76 (patch)
tree456999d501f63d75634a33dbc57306b244777c9d /arch/powerpc/lib/test_emulate_step.c
parent753462512868674a788ecc77bb96752efb818785 (diff)
downloadlinux-777e26f0edf8dab58b8dd474d35d83bde0ac6d76.tar.gz
linux-777e26f0edf8dab58b8dd474d35d83bde0ac6d76.tar.bz2
linux-777e26f0edf8dab58b8dd474d35d83bde0ac6d76.zip
powerpc: Use an accessor for instructions
In preparation for introducing a more complicated instruction type to accommodate prefixed instructions use an accessor for getting an instruction as a u32. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200506034050.24806-8-jniethe5@gmail.com
Diffstat (limited to 'arch/powerpc/lib/test_emulate_step.c')
-rw-r--r--arch/powerpc/lib/test_emulate_step.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/lib/test_emulate_step.c b/arch/powerpc/lib/test_emulate_step.c
index 85d62f16d07a..b928b21feac1 100644
--- a/arch/powerpc/lib/test_emulate_step.c
+++ b/arch/powerpc/lib/test_emulate_step.c
@@ -847,12 +847,12 @@ static int __init emulate_compute_instr(struct pt_regs *regs,
{
struct instruction_op op;
- if (!regs || !instr)
+ if (!regs || !ppc_inst_val(instr))
return -EINVAL;
if (analyse_instr(&op, regs, instr) != 1 ||
GETTYPE(op.type) != COMPUTE) {
- pr_info("emulation failed, instruction = 0x%08x\n", instr);
+ pr_info("emulation failed, instruction = 0x%08x\n", ppc_inst_val(instr));
return -EFAULT;
}
@@ -866,13 +866,13 @@ static int __init execute_compute_instr(struct pt_regs *regs,
extern int exec_instr(struct pt_regs *regs);
extern s32 patch__exec_instr;
- if (!regs || !instr)
+ if (!regs || !ppc_inst_val(instr))
return -EINVAL;
/* Patch the NOP with the actual instruction */
patch_instruction_site(&patch__exec_instr, instr);
if (exec_instr(regs)) {
- pr_info("execution failed, instruction = 0x%08x\n", instr);
+ pr_info("execution failed, instruction = 0x%08x\n", ppc_inst_val(instr));
return -EFAULT;
}