From: Yang Shi <yang.shi@linaro.org>
To: ast@kernel.org, daniel@iogearbox.net, catalin.marinas@arm.com,
will.deacon@arm.com
Cc: zlim.lnx@gmail.com, xi.wang@gmail.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linaro-kernel@lists.linaro.org, yang.shi@linaro.org
Subject: [PATCH 1/2] arm64: bpf: fix JIT frame pointer setup
Date: Thu, 12 Nov 2015 13:57:00 -0800 [thread overview]
Message-ID: <1447365421-1309-2-git-send-email-yang.shi@linaro.org> (raw)
In-Reply-To: <1447365421-1309-1-git-send-email-yang.shi@linaro.org>
BPF fp should point to the top of the BPF prog stack. The original
implementation made it point to the bottom incorrectly.
Move A64_SP to fp before reserve BPF prog stack space.
CC: Zi Shen Lim <zlim.lnx@gmail.com>
CC: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Yang Shi <yang.shi@linaro.org>
---
arch/arm64/net/bpf_jit_comp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index a44e529..ac8b548 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -161,12 +161,12 @@ static void build_prologue(struct jit_ctx *ctx)
if (ctx->tmp_used)
emit(A64_PUSH(tmp1, tmp2, A64_SP), ctx);
- /* Set up BPF stack */
- emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx);
-
/* Set up frame pointer */
emit(A64_MOV(1, fp, A64_SP), ctx);
+ /* Set up BPF stack */
+ emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx);
+
/* Clear registers A and X */
emit_a64_mov_i64(ra, 0, ctx);
emit_a64_mov_i64(rx, 0, ctx);
--
2.0.2
next prev parent reply other threads:[~2015-11-12 22:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-12 21:56 [PATCH V2 0/2] arm64: bpf: correct JIT stack setup and make it align with ARM64 AAPCS Yang Shi
2015-11-12 21:57 ` Yang Shi [this message]
2015-11-13 3:21 ` [PATCH 1/2] arm64: bpf: fix JIT frame pointer setup Z Lim
2015-11-16 19:39 ` David Miller
2015-11-12 21:57 ` [PATCH 2/2] arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS Yang Shi
2015-11-13 3:28 ` Z Lim
2015-11-13 17:28 ` Shi, Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447365421-1309-2-git-send-email-yang.shi@linaro.org \
--to=yang.shi@linaro.org \
--cc=ast@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=daniel@iogearbox.net \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=will.deacon@arm.com \
--cc=xi.wang@gmail.com \
--cc=zlim.lnx@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®