arm64: module: ensure instruction is little-endian before manipulation
authorWill Deacon <will.deacon@arm.com>
Tue, 5 Nov 2013 10:16:52 +0000 (10:16 +0000)
committerMark Brown <broonie@linaro.org>
Tue, 20 May 2014 12:00:52 +0000 (13:00 +0100)
commit357b5fc58a0674ef011105f16c7711f48b9f7b92
tree59e4446d0ad4e74b7a1077c29b07b4c0ed23655c
parent9f6c84430ab91a90bb4265eec43e0b235e2c6cf5
arm64: module: ensure instruction is little-endian before manipulation

Relocations that require an instruction immediate to be re-encoded must
ensure that the instruction pattern is represented in a little-endian
format for the manipulation code to work correctly.

This patch converts the loaded instruction into native-endianess prior
to encoding and then converts back to little-endian byteorder before
updating memory.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Tested-by: Matthew Leach <matthew.leach@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 122e2fa0d310d262cb85cf0b003032e5d2bc2ae7)

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
(cherry picked from commit 36bada1e73f23f948283f97caf775f3428e56af8)
Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/kernel/module.c