Thread (8 messages) 8 messages, 2 authors, 2016-12-06

Re: [PATCH] PPC: sstep.c: Add modsw, moduw instruction emulation

From: Naveen N. Rao <hidden>
Date: 2016-12-05 08:24:12

On 2016/12/04 10:25PM, PrasannaKumar Muralidharan wrote:
Add modsw and moduw instruction emulation support to analyse_instr.

Signed-off-by: PrasannaKumar Muralidharan <redacted>
Hi Prasanna,
Thanks for the patch! A few minor comments below...
quoted hunk ↗ jump to hunk
---
 arch/powerpc/lib/sstep.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 9c78a9c..5acef72 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -1148,6 +1148,15 @@ int __kprobes analyse_instr(struct instruction_op *op, struct pt_regs *regs,
 				(int) regs->gpr[rb];
 			goto arith_done;

+		case 779:	/* modsw */
+			regs->gpr[rd] = (int) regs->gpr[ra] %
+				(int) regs->gpr[rb];
+			goto arith_done;
Since these instructions don't update CR, you can directly goto 
instr_done.
+
+		case 267:	/* moduw */
Please move this case further up so that the extended opcodes are in 
numerical order.


- Naveen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help