On Mon, Jun 22, 2020 at 5:10 PM Balamuruhan S <bal...@linux.ibm.com> wrote:
>
> On test failure, `pr_log()` prints 4 bytes instruction
> irrespective of word/prefix instruction, fix it by printing
> them appropriately.
This patch to add a ppc_inst_as_str() function should help with this,
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20200602052728.18227-1-jniet...@gmail.com/
>
> Signed-off-by: Balamuruhan S <bal...@linux.ibm.com>
> ---
> arch/powerpc/lib/test_emulate_step.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/lib/test_emulate_step.c
> b/arch/powerpc/lib/test_emulate_step.c
> index d5902b7b4e5c..e3b1797adfae 100644
> --- a/arch/powerpc/lib/test_emulate_step.c
> +++ b/arch/powerpc/lib/test_emulate_step.c
> @@ -1225,7 +1225,14 @@ static int __init emulate_compute_instr(struct pt_regs
> *regs,
>
> if (analyse_instr(&op, regs, instr) != 1 ||
> GETTYPE(op.type) != COMPUTE) {
> - pr_info("emulation failed, instruction = 0x%08x\n",
> ppc_inst_val(instr));
> + if (!ppc_inst_prefixed(instr)) {
> + pr_info("emulation failed, instruction = 0x%08x\n",
> + ppc_inst_val(instr));
> + } else {
> + pr_info("emulation failed, instruction = 0x%08x
> 0x%08x\n",
> + ppc_inst_val(instr),
> + ppc_inst_suffix(instr));
> + }
> return -EFAULT;
> }
>
> --
> 2.24.1
>