]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
powerpc: Don't emulate mr. instructions
authorAnanth N Mavinakayanahalli <ananth@in.ibm.com>
Fri, 6 Feb 2009 02:02:00 +0000 (02:02 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 10 Feb 2009 03:39:07 +0000 (14:39 +1100)
Currently emulate_step() emulates mr. instructions without updating cr0
and this can be disastrous. Don't emulate mr.

This bug has been around for a while, but I am not sure if its a worthy
-stable candidate. I'll leave it to Ben do decide.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/lib/sstep.c

index 4aae0c3876452919d17b95322682ea7486d0beb6..13b7d54f185bba4013ff736cfaa54035c5072d38 100644 (file)
@@ -172,6 +172,8 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
                        }
                        break;
                case 0x378:     /* orx */
+                       if (instr & 1)
+                               break;
                        rs = (instr >> 21) & 0x1f;
                        rb = (instr >> 11) & 0x1f;
                        if (rs == rb) {         /* mr */