[PATCH] powerpc/lib/sstep.c - Fix emulation fall-through

Andrew Donnellan andrew.donnellan at au1.ibm.com
Tue Feb 16 11:59:37 AEDT 2016


On 16/02/16 10:28, Oliver O'Halloran wrote:
> 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 a 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 at gmail.com>

The title should probably be "powerpc/sstep: fix switch fallthrough in 
instruction emulation" to be consistent with our usual patch titling 
practice. Please respin.

Apart from that, I'm reasonably convinced this is an appropriate fix:

Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan at au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited



More information about the Linuxppc-dev mailing list