ARM: alignment: correctly decode instructions in BE8 mode.
authorBen Dooks <ben.dooks@codethink.co.uk>
Thu, 18 Jul 2013 20:10:56 +0000 (21:10 +0100)
committerVictor Kamensky <victor.kamensky@linaro.org>
Thu, 13 Mar 2014 21:48:33 +0000 (14:48 -0700)
commit2037b6f8fdba30601e92c10b3d9f79e81d82e9bd
tree668c454c5ccb2e6dac26dd8b264ed953baa3c8df
parent17225ab47c37bc578fa4ef5aac5f2368fc503c37
ARM: alignment: correctly decode instructions in BE8 mode.

If we are in BE8 mode, we must deal with the instruction stream being
in LE order when data is being loaded in BE order. Ensure the data is
swapped before processing to avoid thre following:

Change to using <asm/opcodes.h> to provide the necessary conversion
functions to change the byte ordering.

This stops the following warning messages from the kernel on a fault:

Unhandled fault: alignment exception (0x001) at 0xbfa09567
Alignment trap: not handling instruction 030091e8 at [<80333e8c>]

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
(cherry picked from commit 8592edf0dec8159fde379eb7e056eaddbbd697f2)

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
arch/arm/mm/alignment.c