Commit 5bcaa4cc authored by Anton Blanchard's avatar Anton Blanchard Committed by Michael Ellerman

powerpc/sstep: Fix issues with mcrf

mcrf broke when we changed analyse_instr() to not modify the register
state. The instruction writes to the CR, so we need to store the result
in op->ccval, not op->val.

Fixes: 3cdfcbfd ("powerpc: Change analyse_instr so it doesn't modify *regs")
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent ad47ff3e
...@@ -1513,10 +1513,10 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, ...@@ -1513,10 +1513,10 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
op->type = COMPUTE + SETCC; op->type = COMPUTE + SETCC;
imm = 0xf0000000UL; imm = 0xf0000000UL;
val = regs->gpr[rd]; val = regs->gpr[rd];
op->val = regs->ccr; op->ccval = regs->ccr;
for (sh = 0; sh < 8; ++sh) { for (sh = 0; sh < 8; ++sh) {
if (instr & (0x80000 >> sh)) if (instr & (0x80000 >> sh))
op->val = (op->val & ~imm) | op->ccval = (op->ccval & ~imm) |
(val & imm); (val & imm);
imm >>= 4; imm >>= 4;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment