alistair23-linux/arch/arm64
Yang Shi ec0738db8d arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS
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:

                                 high
         original A64_SP =>   0:+-----+ BPF prologue
                                |FP/LR|
         current A64_FP =>  -16:+-----+
                                | ... | callee saved registers
                                +-----+
                                |     | x25/x26
         BPF fp register => -80:+-----+
                                |     |
                                | ... | BPF prog stack
                                |     |
                                |     |
         current A64_SP =>      +-----+
                                |     |
                                | ... | Function call stack
                                |     |
                                +-----+
                                  low

CC: Zi Shen Lim <zlim.lnx@gmail.com>
CC: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Yang Shi <yang.shi@linaro.org>
Acked-by: Zi Shen Lim <zlim.lnx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-11-17 14:44:39 -05:00
..
boot ARM: DT updates for v4.4 2015-11-10 15:06:26 -08:00
configs ARM: SoC defconfig updates for v4.4 2015-11-10 15:08:32 -08:00
crypto
include s390: A bunch of fixes and optimizations for interrupt and time 2015-11-05 16:26:26 -08:00
kernel ARM: SoC driver updates for v4.4 2015-11-10 15:00:03 -08:00
kvm s390: A bunch of fixes and optimizations for interrupt and time 2015-11-05 16:26:26 -08:00
lib arm64: add KASAN support 2015-10-12 17:46:36 +01:00
mm arm64: fixup for mm renames 2015-11-07 16:45:51 -08:00
net arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS 2015-11-17 14:44:39 -05:00
xen
Kconfig IOMMU Updates for Linux v4.4 2015-11-05 16:12:10 -08:00
Kconfig.debug arm64: Clean config usages for page size 2015-10-19 17:53:57 +01:00
Kconfig.platforms ARM: DT updates for v4.4 2015-11-10 15:06:26 -08:00
Makefile arm64 updates for 4.4: 2015-11-04 14:47:13 -08:00