From: Markos Chandras Date: Mon, 23 Jun 2014 09:38:47 +0000 (+0100) Subject: MIPS: bpf: Use the LO register to get division's quotient X-Git-Tag: v4.9.8~6172^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35a8e16abe36d385d602997e1500a668d2b9c5cf;p=platform%2Fkernel%2Flinux-rpi3.git MIPS: bpf: Use the LO register to get division's quotient Reading from the HI register to get the division result is wrong. The quotient is placed in the LO register. Signed-off-by: Markos Chandras Cc: "David S. Miller" Cc: Daniel Borkmann Cc: Alexei Starovoitov Cc: netdev@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7122/ Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c index f7c2064..5cc92c4 100644 --- a/arch/mips/net/bpf_jit.c +++ b/arch/mips/net/bpf_jit.c @@ -408,7 +408,7 @@ static inline void emit_div(unsigned int dst, unsigned int src, u32 *p = &ctx->target[ctx->idx]; uasm_i_divu(&p, dst, src); p = &ctx->target[ctx->idx + 1]; - uasm_i_mfhi(&p, dst); + uasm_i_mflo(&p, dst); } ctx->idx += 2; /* 2 insts */ }