aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Dooks <ben.dooks@codethink.co.uk>2013-07-24 15:44:56 +0100
committerVictor Kamensky <victor.kamensky@linaro.org>2014-03-13 14:48:36 -0700
commit9884db0b95b316311fc47dcc9456b6d678631e27 (patch)
treedd1b35aa8f7aac08759c19311b6556ff71fa3fe3
parentfb2feb1831b02408515b00de10b6824fb758d88f (diff)
downloadlinux-linaro-stable-9884db0b95b316311fc47dcc9456b6d678631e27.tar.gz
ARM: net: fix arm instruction endian-ness in bpf_jit_32.c
Use <asm/opcodes.h> to correctly transform instruction byte ordering into in-memory ordering. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reviewed-by: Dave Martin <Dave.Martin@arm.com> (cherry picked from commit 3460743e025addc1ecbd496db2231181a2431774) Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
-rw-r--r--arch/arm/net/bpf_jit_32.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index 6de423dbd385..78351ca8d51e 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -19,6 +19,7 @@
#include <linux/if_vlan.h>
#include <asm/cacheflush.h>
#include <asm/hwcap.h>
+#include <asm/opcodes.h>
#include "bpf_jit_32.h"
@@ -113,8 +114,11 @@ static u32 jit_udiv(u32 dividend, u32 divisor)
static inline void _emit(int cond, u32 inst, struct jit_ctx *ctx)
{
+ inst |= (cond << 28);
+ inst = __opcode_to_mem_arm(inst);
+
if (ctx->target != NULL)
- ctx->target[ctx->idx] = inst | (cond << 28);
+ ctx->target[ctx->idx] = inst;
ctx->idx++;
}