]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
powerpc/sstep: Fix emulation fall-through
authorOliver O'Halloran <oohall@gmail.com>
Tue, 16 Feb 2016 06:31:53 +0000 (17:31 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 11 May 2016 11:54:08 +0000 (21:54 +1000)
commit66707836062db62756b395d1fb16ab02ff162862
tree6bc7ce574c571f2542e9b47fc8a4a2df388f8fd2
parentdd21731022faf43c1250050e5d28d11add599149
powerpc/sstep: Fix emulation fall-through

There is a switch fallthough in instr_analyze() which can cause an
invalid instruction to be emulated as a different, valid, instruction.
The rld* (opcode 30) case extracts a sub-opcode from bits 3:1 of the
instruction word. However, the only valid values of this field are 001
and 000. These cases are correctly handled, but the others are not which
causes execution to fall through into case 31.

Breaking out of the switch causes the instruction to be marked as
unknown and allows the caller to deal with the invalid instruction in a
manner consistent with other invalid instructions.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/lib/sstep.c