alistair23-linux/arch
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
..
alpha mm: mlock: add mlock flags to enable VM_LOCKONFAULT usage 2015-11-05 19:34:48 -08:00
arc DeviceTree updates for 4.4: 2015-11-06 12:17:09 -08:00
arm bpf, arm: start flushing icache range from header 2015-11-16 14:40:49 -05:00
arm64 arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS 2015-11-17 14:44:39 -05:00
avr32 dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00
blackfin Merge branch 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2015-10-04 16:31:13 +01:00
c6x irqdomain: Use irq_domain_get_of_node() instead of direct field access 2015-10-13 19:01:23 +02:00
cris cris: Drop reference to get_cmos_time() 2015-11-02 20:03:05 +01:00
frv kmap_atomic_to_page() has no users, remove it 2015-11-09 15:11:24 -08:00
h8300 DeviceTree updates for 4.4: 2015-11-06 12:17:09 -08:00
hexagon Linux 4.3-rc4 2015-10-06 17:10:28 +02:00
ia64 Power management and ACPI updates for v4.4-rc1 2015-11-04 18:10:13 -08:00
m32r Linux 4.3-rc4 2015-10-06 17:10:28 +02:00
m68k block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
metag Metag architecture changes for v4.4 2015-11-10 16:24:25 -08:00
microblaze kmap_atomic_to_page() has no users, remove it 2015-11-09 15:11:24 -08:00
mips kmap_atomic_to_page() has no users, remove it 2015-11-09 15:11:24 -08:00
mn10300 Linux 4.3-rc4 2015-10-06 17:10:28 +02:00
nios2 nios2 update for v4.4-rc1 2015-11-09 16:36:10 -08:00
openrisc
parisc Merge branch 'akpm' (patches from Andrew) 2015-11-09 21:05:13 -08:00
powerpc Merge branch 'for-4.4/io-poll' of git://git.kernel.dk/linux-block 2015-11-10 17:23:49 -08:00
s390 s390: A bunch of fixes and optimizations for interrupt and time 2015-11-05 16:26:26 -08:00
score Merge branch 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2015-10-04 16:31:13 +01:00
sh Merge branch 'akpm' (patches from Andrew) 2015-11-07 14:32:45 -08:00
sparc sparc/sparc64: allocate sys_membarrier system call number 2015-11-09 15:11:24 -08:00
tile kmap_atomic_to_page() has no users, remove it 2015-11-09 15:11:24 -08:00
um um: Switch clocksource to hrtimers 2015-11-06 22:54:49 +01:00
unicore32 power supply and reset changes for the v4.4 series 2015-11-05 12:28:15 -08:00
x86 Merge branch 'for-linus-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2015-11-10 16:33:37 -08:00
xtensa Merge branch 'for-4.4/io-poll' of git://git.kernel.dk/linux-block 2015-11-10 17:23:49 -08:00
.gitignore
Kconfig