powerpc: sstep.c: Add modsw, moduw instruction emulation
PATCH v2 1/1 powerpc: sstep.c: Add modsw, moduw instruction emulation
Add modsw and moduw instruction emulation support to analyse_instr. modsw is an x-form instruction that calculates signed modulo of values stored in registers. moduw is similar to modsw but it works with unsigned values.
Changes in v2:
Don't update CR register as the instruction does not touch that Arrange extended opcode in numerical order
--- arch/powerpc/lib/sstep.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/powerpc/lib/sstep.c +9 -0
@@ -1128,6 +1128,11 @@ int __kprobes analyse_instr(struct instruction_op *op, struct pt_regs *regs,case 266 :/* add */ regs->gpr[rd] = regs->gpr[ra] + regs->gpr[rb]; goto arith_done; + +case 267 :/* moduw */ + regs->gpr[rd] = (unsigned int ) regs->gpr[ra] % + (unsigned int ) regs->gpr[rb]; + goto instr_done;#ifdef __powerpc64__case 457 :/* divdu */ regs->gpr[rd] = regs->gpr[ra] / regs->gpr[rb];
@@ -1148,6 +1153,10 @@ 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 instr_done;/* * Logical instructions
Signature · 1 line
2.9.3
Quoted 8 lines · PrasannaKumar Muralidharan
Add modsw and moduw instruction emulation support to
analyse_instr. modsw is an x-form instruction that calculates signed modulo of values stored in registers. moduw is similar to modsw but it works with unsigned values.Changes in v2:
Don't update CR register as the instruction does not touch that Arrange extended opcode in numerical order
This changelog should come after '---' below so that it doesn't get included in the commit message.
Apart from that, for this patch:
Thanks!
Quoted 36 lines
Signed-off-by PrasannaKumar Muralidharan <[email protected]>--- arch/powerpc/lib/sstep.c | 9 +++++++++ 1 file changed, 9 insertions(+)arch/powerpc/lib/sstep.c +9
-0@@ -1128,6 +1128,11 @@ int __kprobes analyse_instr(struct instruction_op *op, struct pt_regs *regs,case 266 :/* add */ regs->gpr[rd] = regs->gpr[ra] + regs->gpr[rb]; goto arith_done; + +case 267 :/* moduw */ + regs->gpr[rd] = (unsigned int ) regs->gpr[ra] % + (unsigned int ) regs->gpr[rb]; + goto instr_done;#ifdef __powerpc64__case 457 :/* divdu */ regs->gpr[rd] = regs->gpr[ra] / regs->gpr[rb];@@ -1148,6 +1153,10 @@ 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 instr_done;/* * Logical instructions Signature · 1 line
2.9.3
Hi Naveen,
Quoted 11 lines
Quoted 8 lines
Add modsw and moduw instruction emulation support to
analyse_instr. modsw is an x-form instruction that calculates signed modulo of values stored in registers. moduw is similar to modsw but it works with unsigned values.Changes in v2:
Don't update CR register as the instruction does not touch that Arrange extended opcode in numerical orderThis changelog should come after '---' below so that it doesn't get included in the commit message.
Oh, I see. Should I send the patch again with the above change? If so should I mark it v3 or just v2?
Quoted 2 lines
Apart from that, for this patch:
Reviewed-by Naveen N. Rao <[email protected]>
Thanks and regards,
PrasannaKumar
Quoted 11 lines · PrasannaKumar Muralidharan
Hi Naveen,
Quoted 9 lines
Quoted 8 lines
Add modsw and moduw instruction emulation support to
analyse_instr. modsw is an x-form instruction that calculates signed modulo of values stored in registers. moduw is similar to modsw but it works with unsigned values.Changes in v2:
Don't update CR register as the instruction does not touch that Arrange extended opcode in numerical order
Quoted 5 lines
Quoted 2 lines
This changelog should come after '---' below so that it doesn't get included in the commit message.
Oh, I see. Should I send the patch again with the above change? If so should I mark it v3 or just v2?
Easier for benh/mpe if you do ;)
Be sure to include my reviewed-by tag in your v3.
- Naveen
Quoted 7 lines
Quoted 3 lines
Apart from that, for this patch:
Reviewed-by Naveen N. Rao <[email protected]>Thanks and regards,
PrasannaKumar
Quoted 5 lines
Quoted 2 lines
Oh, I see. Should I send the patch again with the above change? If so should I mark it v3 or just v2?
Easier for benh/mpe if you do ;)
Be sure to include my reviewed-by tag in your v3.
Sure. I will send v3.