]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc: Fix single step emulation of 32bit overflowed branches
authorMichael Neuling <mikey@neuling.org>
Mon, 6 May 2013 11:32:40 +0000 (21:32 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Jun 2013 06:55:13 +0000 (16:55 +1000)
Check truncate_if_32bit() on final write to nip.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/lib/sstep.c

index e15c521846ca924291bca5b9dc923ec5275d3e69..99c7fc16dc0d3ffe7ad59a746b085bd888961f00 100644 (file)
@@ -580,7 +580,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
                if (instr & 1)
                        regs->link = regs->nip;
                if (branch_taken(instr, regs))
-                       regs->nip = imm;
+                       regs->nip = truncate_if_32bit(regs->msr, imm);
                return 1;
 #ifdef CONFIG_PPC64
        case 17:        /* sc */