aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2014-06-23 05:39:00 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-06-26 05:48:23 -0400
commitd8214ef14a1db4172c93e5694906bda9b00fac93 (patch)
tree358519a6be8f7e3c629ab40b1e5158ccaad870a7 /arch
parentb6a14a9845259eb21c9d8121330c4c3b22de182e (diff)
MIPS: bpf: Fix stack space allocation for BPF memwords on MIPS64
When allocating stack space for BPF memwords we need to use the appropriate 32 or 64-bit instruction to avoid losing the top 32 bits of the stack pointer. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Daniel Borkmann <dborkman@redhat.com> Cc: Alexei Starovoitov <ast@plumgrid.com> Cc: netdev@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7135/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/net/bpf_jit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 6e3963425b64..b87390a56a2f 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -623,7 +623,10 @@ static void save_bpf_jit_regs(struct jit_ctx *ctx, unsigned offset)
623 if (ctx->flags & SEEN_MEM) { 623 if (ctx->flags & SEEN_MEM) {
624 if (real_off % (RSIZE * 2)) 624 if (real_off % (RSIZE * 2))
625 real_off += RSIZE; 625 real_off += RSIZE;
626 emit_addiu(r_M, r_sp, real_off, ctx); 626 if (config_enabled(CONFIG_64BIT))
627 emit_daddiu(r_M, r_sp, real_off, ctx);
628 else
629 emit_addiu(r_M, r_sp, real_off, ctx);
627 } 630 }
628} 631}
629 632