Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271617

Re: [PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS
Date 2015-11-17 20:50 +0100
Message-ID <qvUqm-TY-17@gated-at.bofh.it> (permalink)
References <quz4C-6oN-1@gated-at.bofh.it> <qvAUG-4Yp-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Yang Shi <yang.shi@linaro.org>
Date: Mon, 16 Nov 2015 14:35:35 -0800

> Save and restore FP/LR in BPF prog prologue and epilogue, save SP to FP
> in prologue in order to get the correct stack backtrace.
> 
> However, ARM64 JIT used FP (x29) as eBPF fp register, FP is subjected to
> change during function call so it may cause the BPF prog stack base address
> change too.
> 
> Use x25 to replace FP as BPF stack base register (fp). Since x25 is callee
> saved register, so it will keep intact during function call.
> It is initialized in BPF prog prologue when BPF prog is started to run
> everytime. Save and restore x25/x26 in BPF prologue and epilogue to keep
> them intact for the outside of BPF. Actually, x26 is unnecessary, but SP
> requires 16 bytes alignment.
> 
> So, the BPF stack layout looks like:
 ...
> Signed-off-by: Yang Shi <yang.shi@linaro.org>

Applied, thank you.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS Yang Shi <yang.shi@linaro.org> - 2015-11-17 00:00 +0100
  Re: [PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue align  with ARM64 AAPCS Z Lim <zlim.lnx@gmail.com> - 2015-11-17 05:40 +0100
    Re: [PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue align  with ARM64 AAPCS Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2015-11-17 05:50 +0100
      Re: [PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue align  with ARM64 AAPCS "Shi, Yang" <yang.shi@linaro.org> - 2015-11-17 05:50 +0100
      Re: [PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue  align with ARM64 AAPCS David Miller <davem@davemloft.net> - 2015-11-17 18:00 +0100
  Re: [PATCH V4 2/2] arm64: bpf: make BPF prologue and epilogue  align with ARM64 AAPCS David Miller <davem@davemloft.net> - 2015-11-17 20:50 +0100

csiph-web