[PATCH 2/6] powerpc test_emulate_step: fix pr_info() to print 8-byte for prefixed instruction

Balamuruhan S bala24 at linux.ibm.com
Mon Jun 22 17:09:37 AEST 2020


On test failure, `pr_log()` prints 4 bytes instruction
irrespective of word/prefix instruction, fix it by printing
them appropriately.

Signed-off-by: Balamuruhan S <bala24 at 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



More information about the Linuxppc-dev mailing list